The numeric value of the blue channel between [0, 1].
A CSS-compatible color string. If this color is not valid, the empty string is returned. An alias for Color#toString.
The numeric value of the green channel between [0, 1].
The color represented as an HSL array. Assumes r, g, and b are contained in the set [0, 1] and returns h, s, and l in the set [0, 1].
The color represented as an HSV array. Conversion formula adapted from http://en.wikipedia.org/wiki/HSV_color_space. Assumes r, g, and b are contained in the set [0, 1] and returns h, s, and v in the set [0, 1].
The color represented as a linear RGB array. Assumes r, g, and b are contained in the set [0, 1] and returns linear r, g, and b in the set [0, 1].
Get the value of this color in little endian format.
The maximum value of all channels.
The minimum value of all channels.
The numeric value of the red channel between [0, 1].
The color represented as an RGB array.
Is this a valid color?
Iterating over a Color is equivalent to iterating over its [r,g,b] color channels.
Set an rgb array with the rgb values contained in this Color class.
Receive the result. Must be an array with at least a length of 3.
Test whether this color equals some other color
Some other color or hex number
Are the colors equal?
Returns the color as a CSS string.
The color as a CSS string
Serialize the Color.
The color as a CSS string
Get a CSS-compatible RGBA color string.
The desired alpha in the range [0, 1]
A CSS-compatible RGBA string
StaticaddAdd two colors.
The first color.
The second color.
The resulting color as a number.
StaticaddAdd a static scalar to a color.
The color.
Scalar to add with (normalized).
The resulting color as a number.
StaticapplyRGBConvert a color to RGB and assign values to a passed array.
The color to convert to RGB values.
Receive the result. Must be an array with at least a length of 3.
StaticfromCreate a Color instance from an RGB array.
A color input
The hex color instance or NaN
StaticfromHSLCreate a Color instance from an HSL array. Assumes h, s, and l are contained in the set [0, 1].
An HSL tuple
The hex color instance
StaticfromHSVCreate a Color instance from an HSV array. Conversion formula adapted from http://en.wikipedia.org/wiki/HSV_color_space. Assumes h, s, and v are contained in the set [0, 1].
An HSV tuple
The hex color instance
StaticfromCreate a Color instance (sRGB) from a linear rgb array. Assumes r, g, and b are contained in the set [0, 1].
The linear rgb array
The hex color instance
StaticfromRGBCreate a Color instance from an RGB array.
An RGB tuple
The hex color instance
StaticfromRGBvaluesCreate a Color instance from an RGB normalized values.
The red value
The green value
The blue value
The hex color instance
StaticfromCreate a Color instance from a color string which either includes or does not include a leading #.
A color string
The hex color instance
StaticmaximizeMaximize two colors.
The first color.
The second color.
The result.
StaticmaximizeMaximize a color by a static scalar.
The color to maximize.
Scalar to maximize with (normalized).
The resulting color as a number.
StaticminimizeMinimize two colors.
The first color.
The second color.
StaticminimizeMinimize a color by a static scalar.
The color.
Scalar to minimize with (normalized).
StaticmixApply a linear interpolation between two colors, according to the weight.
The first color to mix.
The second color to mix.
Weight of the linear interpolation.
The resulting mixed color
StaticmultiplyMultiply two colors.
The first color to multiply.
The second color to multiply.
The result.
StaticmultiplyMultiply a color by a scalar
The color to multiply.
A static scalar to multiply with.
The resulting color as a number.
StaticsubtractSubtract two colors.
The first color.
The second color.
StaticsubtractSubtract a color by a static scalar.
The color.
Scalar to subtract with (normalized).
The resulting color as a number.
A representation of a color in hexadecimal format. This class provides methods for transformations and manipulations of colors.