(optional) The red component of the color, if arguments g and b are also defined. If they are not defined, r can be an hexadecimal triplet (recommended), another Color instance or a CSS-style string, for example: 'rgb(250, 0,0)', 'rgb(100%,0%,0%)', 'hsl(0, 100%, 50%)', '#ff0000', '#f00', 'red' (or any X11 color name, all 140 color names are supported).
(optional) If it is defined, the green component of the color.
(optional) If it is defined, the blue component of the color.
Blue channel value between 0 and 1. Default is 1.
Green channel value between 0 and 1. Default is 1.
Red channel value between 0 and 1. Default is 1.
Adds s to the RGB values of this color.
The number to add to the RGB values of this color.
Returns a new Color with the same r, g and b values as this one.
Converts this color from gamma to linear space.
Converts this color from linear space to gamma space.
Compares the RGB values of color with those of this object. Returns true if they are the same, false otherwise.
The Color to compare this one against.
Sets this color's components based on an array formatted like [r, g, b]
Array of floats in the form [r, g, b].
An optional offset into the array.
Returns the hexadecimal value of this color.
Returns the hexadecimal value of this color as a string, without the '#' prefix (for example, 'FFFFFF').
Returns the value of this color as a CSS-style string. Example: rgb(255,0,0)
Linearly interpolates this color's RGB values toward the RGB values of color. The alpha argument can be thought of as the ratio between the two colors, where 0.0 is this color and 1.0 is the first argument.
Color to converge on.
A number between 0 and 1.
Multiplies this color's RGB values by s.
The number to multiply this color's RGB values by.
Adds the given h, s, and l to this color's values. Internally, this converts this color's RGB values to HSL, adds h, s, and l, and then converts the color back to RGB.
Sets color from HSL values.
hue value between 0.0 and 1.0
saturation value between 0.0 and 1.0
lightness value between 0.0 and 1.0
Sets this color from an hexadecimal value.
Color in hexadecimal.
Sets this color from RGB values.
Red channel value between 0 and 1.
Green channel value between 0 and 1.
Blue channel value between 0 and 1.
Sets all three color r, g, b components of this color to the value scalar.
a value between 0.0 and 1.0.
Sets this color from a CSS-style string. For example, "rgb(250, 0,0)", "rgb(100%, 0%, 0%)", "hsl(0, 100%, 50%)", "#ff0000", "#f00", or "red" (or any X11 color name, all 140 color names are supported). Transluent colors such as "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" are also accepted, but the alpha-channel value will be discarded.
color as a CSS-style string.
Returns an array of the form [r, g, b].
An optional array to store the color to.
An optional offset into the array.
Creates a color from the provided r, g, b values.