Converts an array of four values to a Color
. The sequence of the array is
expected to be [r, g, b]
or [r, g, b, a]
.
Creates a Color
from a CSS color value. This function currently only
supports rgb(255, 255, 255)
, rgba(255, 255, 255, 0.5)
or "#FFFFFF"
.
Returns undefined
if the color cannot be parsed.
Returns a Color
from a hex string, or undefined if the color string cannot
be parsed. Supports hex strings in the format of "#00FF00"
, "0x00FF00"
or
"00FF00"
.
Converts a numeric color value containing red, green and blue values to a
Color
. The alpha channel will default to fully opaque.
Returns true
if the color's alpha channel is 0.
Returns true
if the alpha channel of this color is fully opaque (255).
Converts a Color
to a hex string. The returned string will be prefixed with
#
.
Constructs a new color with the given red, green, blue and alpha values. If alpha is undefined, defaults to 1.