XLib


Download
Installation
X-VBA Home

Array
=AverageHigh
=AverageLow
=CountUnique
=IsInArray
=Large
=Reverse
=Small
=Sort
=SumHigh
=SumLow

Color
=Hex2Hsl
=Hex2Rgb
=Hsl2Hex
=Hsl2Rgb
=Rgb2Hex
=Rgb2Hsl
=Rgb2Hsv

DateTime
=DaysOfMonth
=MonthName2
=Quarter
=TimeConverter
=WeekOfMonth
=WeekdayName2

Environment
=ComputerName
=OS
=UserDomain
=UserName

File
=CountFiles
=CountFilesAndFolders
=CountFolders
=CurrentFilePath
=FileCreationTime
=FileDrive
=FileExtension
=FileFolder
=FileLastModifiedTime
=FileName
=FileSize
=FileType
=GetActivePath
=GetActivePathAndName
=GetFileNameByNumber
=PathJoin
=PathSeparator
=ReadFile
=WriteFile

Math
=Ceil
=Floor
=InterpolateNumber
=InterpolatePercent
=Max
=Min
=ModFloat

Meta
=XlibCredits
=XlibDocumentation
=XlibVersion

Network
=Http
=ParseHtmlString
=SimpleHttp

Random
=BigRandBetween
=RandBetween
=RandBetweens
=RandBool
=RandomRange
=RandomSample

Regex
=RegexReplace
=RegexSearch
=RegexTest

StringManipulation
=CamelCase
=Capitalize
=CompanyCase
=CountLowercaseCharacters
=CountUppercaseCharacters
=CountWords
=DedentText
=EliteCase
=Formatter
=InSplit
=IndentText
=KebabCase
=LeftFind
=LeftSearch
=LeftSplit
=RemoveCharacters
=Repeat
=ReverseText
=ReverseWords
=RightFind
=RightSearch
=RightSplit
=ScrambleCase
=ShortenText
=SplitText
=Substr
=SubstrFind
=SubstrSearch
=TextJoin
=TrimChar
=TrimLeft
=TrimRight
=Zfill

StringMetrics
=Damerau
=Hamming
=Levenshtein

Utilities
=BigDec2Hex
=BigHex
=Dec2Hex
=Hex2Dec
=HideText
=HtmlEscape
=HtmlUnescape
=JavaScript
=Jsonify
=Len2
=SpeakText
=UuidFour

Validators
=CreditCardName
=FormatCreditCard
=IsCreditCard
=IsEmail
=IsIPFour
=IsMacAddress
=IsPhone
=IsUrl

Color Module

This module contains a set of functions for working with colors


=Hex2Hsl(hexColorString)

This function converts a HEX color value into an HSL color value

Arguments

{String}: hexColorString   ➔   is the hex color


Returns

{String}: Returns a string with the HSL value of the color


Examples

  • =Hex2Hsl("084080") -> "(212.0, 88.2%, 26.7%)"
  • =Hex2Hsl("#084080") -> "(212.0, 88.2%, 26.7%)"

=Hex2Rgb(hexColorString, [singleColorNumberOrName])

This function converts a HEX color value into an RGB color value, or optionally a single value from the RGB value.

Arguments

{String}: hexColorString   ➔   is the color in HEX format

[(Optional) {Variant = -1}: singleColorNumberOrName]   ➔   is a number or string that specifies which of the single color values to return. If this is set to 0 or "Red", the red value will be returned. If this is set to 1 or "Green", the green value will be returned. If this is set to 2 or "Blue", the blue value will be returned.


Returns

{Variant}: Returns a string with the RGB value of the color or the number of the individual color chosen


Examples

  • =Hex2Rgb("FFFFFF") -> "(255, 255, 255)"
  • =Hex2Rgb("FF0109", 0) -> 255; The red color
  • =Hex2Rgb("FF0109", "Red") -> 255; The red color
  • =Hex2Rgb("FF0109", 1) -> 1; The green color
  • =Hex2Rgb("FF0109", "Green") -> 1; The green color
  • =Hex2Rgb("FF0109", 2) -> 9; The blue color
  • =Hex2Rgb("FF0109", "Blue") -> 9; The blue color

=Hsl2Hex(hueValue, saturationValue, lightnessValue)

This function converts an HSL color value into a HEX color value.

Arguments

{Double}: hueValue   ➔   is the hue value

{Double}: saturationValue   ➔   is the saturation value

{Double}: lightnessValue   ➔   is the lightness value


Returns

{Variant}: Returns a string with the HEX value of the color


Examples

  • =Hsl2Rgb(212, .882, .267) -> "(8, 64, 128)"

=Hsl2Rgb(hueValue, saturationValue, lightnessValue, [singleColorNumberOrName])

This function converts an HSL color value into an RGB color value, or optionally a single value from the RGB value.

Arguments

{Double}: hueValue   ➔   is the hue value

{Double}: saturationValue   ➔   is the saturation value

{Double}: lightnessValue   ➔   is the lightness value

[(Optional) {Variant = -1}: singleColorNumberOrName]   ➔   is a number or string that specifies which of the single color values to return. If this is set to 0 or "Red", the red value will be returned. If this is set to 1 or "Green", the green value will be returned. If this is set to 2 or "Blue", the blue value will be returned.


Returns

{Variant}: Returns a string with the RGB value of the color or an individual color value


Examples

  • =Hsl2Rgb(212, .882, .267) -> "(8, 64, 128)"
  • =Hsl2Rgb(212, .882, .267, 0) -> 8
  • =Hsl2Rgb(212, .882, .267, "Red") -> 8
  • =Hsl2Rgb(212, .882, .267, 1) -> 64
  • =Hsl2Rgb(212, .882, .267, "Green") -> 64
  • =Hsl2Rgb(212, .882, .267, 2) -> 128
  • =Hsl2Rgb(212, .882, .267, "Blue") -> 128

=Rgb2Hex(redColorInteger, greenColorInteger, blueColorInteger)

This function converts an RGB color value into a HEX color value

Arguments

{Integer}: redColorInteger   ➔   is the red value

{Integer}: greenColorInteger   ➔   is the green value

{Integer}: blueColorInteger   ➔   is the blue value


Returns

{String}: Returns a string with the HEX value of the color


Examples

  • =Rgb2Hex(255, 255, 255) -> "FFFFFF"

=Rgb2Hsl(redColorInteger, greenColorInteger, blueColorInteger, [singleColorNumberOrName])

This function converts an RGB color value into an HSL color value and returns a string of the HSL value, or optionally a single value from the HSL value.

Arguments

{Integer}: redColorInteger   ➔   is the red value

{Integer}: greenColorInteger   ➔   is the green value

{Integer}: blueColorInteger   ➔   is the blue value

[(Optional) {Variant = -1}: singleColorNumberOrName]   ➔   is a number or string that specifies which of the single color values to return. If this is set to 0 or "Hue", the hue value will be returned. If this is set to 1 or "Saturation", the saturation value will be returned. If this is set to 2 or "Lightness", the lightness value will be returned.


Returns

{Variant}: Returns a string with the HSL value of the color


Examples

  • =Rgb2Hsl(8, 64, 128) -> "(212.0�, 88.2%, 26.7%)"
  • =Rgb2Hsl(8, 64, 128, 0) -> 212
  • =Rgb2Hsl(8, 64, 128, "Hue") -> 212
  • =Rgb2Hsl(8, 64, 128, 1) -> .882
  • =Rgb2Hsl(8, 64, 128, "Saturation") -> .882
  • =Rgb2Hsl(8, 64, 128, 2) -> .267
  • =Rgb2Hsl(8, 64, 128, "Lightness") -> .267

=Rgb2Hsv(redColorInteger, greenColorInteger, blueColorInteger, [singleColorNumberOrName])

This function converts an RGB color value into an HSV color value, or optionally a single value from the HSV value.

Arguments

{Integer}: redColorInteger   ➔   is the red value

{Integer}: greenColorInteger   ➔   is the green value

{Integer}: blueColorInteger   ➔   is the blue value

[(Optional) {Variant = -1}: singleColorNumberOrName]   ➔   is a number or string that specifies which of the single color values to return. If this is set to 0 or "Hue", the hue value will be returned. If this is set to 1 or "Saturation", the saturation value will be returned. If this is set to 2 or "Value", the value value will be returned.


Returns

{Variant}: Returns a string with the RGB value of the color or an individual color value


Examples

  • =Rgb2Hsv(8, 64, 128) -> "(212.0, 93.8%, 50.2%)"
  • =Rgb2Hsv(8, 64, 128, 0) -> 212
  • =Rgb2Hsv(8, 64, 128, "Red") -> 212
  • =Rgb2Hsv(8, 64, 128, 1) -> .938
  • =Rgb2Hsv(8, 64, 128, "Green") -> .938
  • =Rgb2Hsv(8, 64, 128, 2) -> .502
  • =Rgb2Hsv(8, 64, 128, "Blue") -> .502