calculates the colors brightness (0-255) http://www.w3.org/TR/AERT#color-contrast
compares color with specified one and returns the color contrast defined by (WCAG Version 2)
returns the colors original format possible values: rgb, rgba, hsl, hsla, hex6, hex3, name
returns the original input value
retrieve the colors luminance http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
returns an opaque representation of this color
Optional
opacity: numberoptional opacity ranging from 0 (fully transparent) to 1 (fully opaque). default is 1.
returns the color in RGBA format rgb are in range [0-255] a is in range [0-1]
returns the "best" text color (either white or black) for use on a background of this color algorithm always ensures a minimum contrast ratio of 3:1 as per [ISO-9241-3] and [ANSI-HFES-100-1988]
check if color is transparent
returns the most compact representation of the input value
returns the original input value
Static
compressStatic
getreturns an opaque representation of the specified color
Optional
opacity: numberoptional opacity ranging from 0 (fully transparent) to 1 (fully opaque). default is 1.
Static
getreturns the "best" text color (either white or black) for use on a background of this color algorithm always ensures a minimum contrast ratio of 3:1 as per [ISO-9241-3] and [ANSI-HFES-100-1988]
Static
isStatic
ischeck if specified color is transparent
Optional
color: null | stringStatic
parseOptional
expression: null | stringStatic
randomreturn a random color with the specified brightness
Optional
saturation: numbersaturation of the color. default 0.9
Optional
lightness: numberlightness of the color. default 0.6
Optional
steps: numbernumber of steps. default 30 (12 degree each)
Optional
step: numberindex of a specific step. randomized by default
Static
validate
Simple object representing an RGBA color can be initialized from any valid CSS Expression