Color
Kind: class
new Color()
▸ Color(value, opacity)
Create a new color instance.
string | number | {r:number, g:number, b:number, a:?number}r, g, b, a keys all set to integers from 0 - 255 (if a is omitted, 255 is used)</li></ul>?numbervalue parameter doesn't specify an opacity and you don't want the default 1.0 (100%) opacity.a
▸ a: number
Integer 0-255. Get/set the alpha channel value.
Kind: instance property of Color
r
▸ r: number
Integer 0-255. Get/set the red channel value.
Kind: instance property of Color
g
▸ g: number
Integer 0-255. Get/set the green channel value.
Kind: instance property of Color
b
▸ b: number
Integer 0-255. Get/set the blue channel value.
Kind: instance property of Color
toRgba()
▸ toRgba(): {r:number, g:number, b:number, a:number}
Convert to an object with r, g, b, a keys where r, g, b, a range from 0 - 255.
Kind: instance method of Color
toHex()
▸ toHex(forceSixDigits): string
Convert to hex string with "#" prefix. Ignores the Color's alpha value. Returns a 3-character string in the form #123 if possible, otherwise returns a 6-character string in the form #456ABC.
booleanKind: instance method of Color
clone()
▸ clone(): Color
Returns a clone of the current color object
Kind: instance method of Color