Color
Constructors
rnumber0gnumber0bnumber0anumber1Constructs a color from HSVA color space components.
hnumberHue
snumberSaturation
vnumberValue
anumberAlpha
Constructs a color from a CSS color string.
Hexadecimal, rba, rgba, and named CSS color keywords are supported.
See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
cssStringstringA CSS color string
Constructs a color from a bit-packed number in RGB8 format.
valuenumberA bit-packed color value in RGB8 format.
Properties
The red component
The green component
The blue component
The alpha (or opacity) component
Methods
Returns a copy of this color.
Linearly interpolates this color to the color c by the mixing factor t.
Returns the relative luminance of this color for standard human vision.
Returns a CSS style string for this color.
If fully opaque, this will return a hexadecimal string with a # mark at
the beginning.
If transparent, it will return a string in the form rgba(r, g, b, a).
Returns a CSS style string for this color in hexadecimal format with a #
mark at the beginning.
The resulting string will represent an opaque RGB color. The alpha component of transparent colors will be ignored.
The returned string will be a valid CSS2 color.
Returns a CSS style string for this color in the form rgba(r, g, b, a).
Returns a bit-packed number in RGB8 format, also knows a "hex" color such
as 0xffaabb.
Converts this color to the HSVA color space.
Returns an array of [hue, saturation, value, alpha].
A color in the RGBA color space.