Expand the hex if it is in shorthand
hex color
expanded hex color or original value
Expand the hex single if it is in shorthand
hex single color
expanded hex color or original value
Get the alpha color from color integer or Get the hex alpha color from the hex string if it exists
color integer or hex color
alpha color or hex alpha color in format AA or null
Get the blue color from color integer or Get the hex blue color from the hex string
color integer or hex color
blue color or hex blue color in format BB
Get the green color from color integer or Get the hex green color from the hex string
color integer or hex color
green color or hex green color in format GG
Get the red color from color integer or Get the hex red color from the hex string
color integer or hex color
red color or hex red color in format RR
Check if the arithmetic RGB float color is valid, inclusively between 0.0 and 1.0
decimal color
true if valid
Check if the hex color value is valid
hex color
true if valid
Check if the hex single color value is valid
hex single color
true if valid
Check if the HSL hue float value is valid, inclusively between 0.0 and 360.0
hue value
true if valid
Check if the HSL lightness float value is valid, inclusively between 0.0 and 1.0
lightness value
true if valid
Check if the RBG integer color is valid, inclusively between 0 and 255
decimal color
true if valid
Check if the HSL saturation float value is valid, inclusively between 0.0 and 1.0
saturation value
true if valid
Shorthand the hex color if possible
hex color
shorthand hex color or original value
Shorthand the hex single color if possible
hex single color
shorthand hex color or original value
Convert the RGB integer to an arithmetic RBG float or Convert the hex single color to an arithmetic RBG float
integer color inclusively between 0 and 255 or hex single color in format FF or F
float color inclusively between 0.0 and 1.0
Convert HSL (hue, saturation, and lightness) values to RGB arithmetic values
hue value inclusively between 0.0 and 360.0
saturation inclusively between 0.0 and 1.0
lightness inclusively between 0.0 and 1.0
arithmetic RGB array where: 0 = red, 1 = green, 2 = blue
Convert the RBG values to a color integer or hex color values to a hex color
red integer color inclusively between 0 and 255 or red hex color in format RR or R
green integer color inclusively between 0 and 255 or green hex color in format GG or G
blue integer color inclusively between 0 and 255 or blue hex color in format BB or B
integer color or hex color in format #RRGGBB
Convert the hex color values to a hex color, shorthanded when possible
red hex color in format RR or R
green hex color in format GG or G
blue hex color in format BB or B
hex color in format #RGB or #RRGGBB
Convert the hex color values to a hex color, shorthanded when possible
red hex color in format RR or R
green hex color in format GG or G
blue hex color in format BB or B
alpha hex color in format AA or A, null to not include alpha
hex color in format #ARGB, #RGB, #AARRGGBB, or #RRGGBB
Convert the hex color values to a hex color including an opaque alpha value of FF or F, shorthanded when possible
red hex color in format RR or R
green hex color in format GG or G
blue hex color in format BB or B
hex color in format #ARGB or #AARRGGBB
Convert the RBGA values to a color integer or Convert the hex color values to a hex color
red integer color inclusively between 0 and 255 or red hex color in format RR or R
green integer color inclusively between 0 and 255 or green hex color in format GG or G
blue integer color inclusively between 0 and 255 or blue hex color in format BB or B or alpha hex color in format AA or A, null to not include alpha
alpha integer color inclusively between 0 and 255, -1 to not
include alpha
integer color or hex color in format #AARRGGBB or #RRGGBB
Convert the RBG values to a color integer including an opaque alpha value of 255 or Convert the hex color values to a hex color including an opaque alpha value of FF
red integer color inclusively between 0 and 255 or red hex color in format RR or R
green integer color inclusively between 0 and 255 or green hex color in format GG or G
blue integer color inclusively between 0 and 255 or blue hex color in format BB or B
integer color or hex color in format #AARRGGBB
Convert red, green, and blue arithmetic values to HSL (hue, saturation, lightness) values
red color inclusively between 0.0 and 1.0 or between 0 and 255
green color inclusively between 0.0 and 1.0 or between 0 and 255
blue color inclusively between 0.0 and 1.0 or between 0 and 255
HSL array where: 0 = hue, 1 = saturation, 2 = lightness
Convert the RGB integer to a hex single color
integer color inclusively between 0 and 255 or float color inclusively between 0.0 and 1.0
hex single color in format FF
Convert the arithmetic RGB float to a RBG integer or Convert the hex single color to a RBG integer
float color inclusively between 0.0 and 1.0 or hex single color in format FF or F
integer color inclusively between 0 and 255
Convert HSL (hue, saturation, and lightness) values to RGB integer values
hue value inclusively between 0.0 and 360.0
saturation inclusively between 0.0 and 1.0
lightness inclusively between 0.0 and 1.0
RGB integer array where: 0 = red, 1 = green, 2 = blue
Validate the arithmetic RGB float color is inclusively between 0.0 and 1.0
decimal color
Validate the hex color value
hex color
Validate the hex single color value
hex single color
Validate the HSL hue float value is inclusively between 0.0 and 360.0
hue value
Validate the HSL lightness float value is inclusively between 0.0 and 1.0
lightness value
Validate the RBG integer color is inclusively between 0 and 255
decimal color
Validate the HSL saturation float value is inclusively between 0.0 and 1.0
saturation value
Generated using TypeDoc
Color utilities with support for hex, RBG, arithmetic RBG, HSL, and integer colors
osbornb