Hardware-accelerated geospatial data plotting in the browser
autumnplot-gl • Docs
autumnplot-gl / Color
new Color(
rgba
):Color
Create a new color object
• rgba: [number
, number
, number
, number
]
An RGBA tuple of floats between 0 and 1
get
a():number
The alpha component (opacity) of the color as a float value between 0 and 1
number
get
b():number
The blue component of the color as a float value between 0 and 1
number
get
g():number
The green component of the color as a float value between 0 and 1
number
get
r():number
The red component of the color as a float value between 0 and 1
number
toHSVTuple(): [
number
,number
,number
]
[number
, number
, number
]
The color as a tuple of HSV values
toRGBAHex():
string
string
The color as an RGBA hex string (e.g., ‘#dedbefff’)
toRGBATuple(): [
number
,number
,number
,number
]
[number
, number
, number
, number
]
The color as an RGBA float tuple
toRGBHex():
string
string
The color as an RGB hex string (e.g., ‘#dedbef’)
withOpacity(
opacity
):Color
• opacity: number
The new alpha component (opacity)
A new color with the alpha component set to opacity.
static
fromHSVTuple(hsv
):Color
• hsv: [number
, number
, number
]
A tuple of HSV values
a new Color object
static
fromHex(hex
):Color
• hex: string
An RGB or RGBA hex string to parse
a new Color object