autumnplot-gl

Hardware-accelerated geospatial data plotting in the browser


Project maintained by tsupinie Hosted on GitHub Pages — Theme by mattgraham

autumnplot-glDocs


autumnplot-gl / Color

Class: Color

Constructors

new Color()

new Color(rgba): Color

Create a new color object

Parameters

rgba: [number, number, number, number]

An RGBA tuple of floats between 0 and 1

Returns

Color

Source

Color.ts:100

Accessors

a

get a(): number

The alpha component (opacity) of the color as a float value between 0 and 1

Returns

number

Source

Color.ts:128


b

get b(): number

The blue component of the color as a float value between 0 and 1

Returns

number

Source

Color.ts:121


g

get g(): number

The green component of the color as a float value between 0 and 1

Returns

number

Source

Color.ts:114


r

get r(): number

The red component of the color as a float value between 0 and 1

Returns

number

Source

Color.ts:107

Methods

toHSVTuple()

toHSVTuple(): [number, number, number]

Returns

[number, number, number]

The color as a tuple of HSV values

Source

Color.ts:164


toRGBAHex()

toRGBAHex(): string

Returns

string

The color as an RGBA hex string (e.g., ‘#dedbefff’)

Source

Color.ts:150


toRGBATuple()

toRGBATuple(): [number, number, number, number]

Returns

[number, number, number, number]

The color as an RGBA float tuple

Source

Color.ts:157


toRGBHex()

toRGBHex(): string

Returns

string

The color as an RGB hex string (e.g., ‘#dedbef’)

Source

Color.ts:143


withOpacity()

withOpacity(opacity): Color

Parameters

opacity: number

The new alpha component (opacity)

Returns

Color

A new color with the alpha component set to opacity.

Source

Color.ts:136


fromHSVTuple()

static fromHSVTuple(hsv): Color

Parameters

hsv: [number, number, number]

A tuple of HSV values

Returns

Color

a new Color object

Source

Color.ts:180


fromHex()

static fromHex(hex): Color

Parameters

hex: string

An RGB or RGBA hex string to parse

Returns

Color

a new Color object

Source

Color.ts:172