@tempots/color

RGBA class

Represents a color in the RGBA format.

Signature:

declare class RGBA 

Constructors

Constructor

Modifiers

Description

(constructor)(value)

Creates a new RGBA instance.

Properties

Property

Modifiers

Type

Description

alpha

readonly

number

Gets the alpha component of the color.

blue

readonly

number

Gets the blue component of the color.

equals

readonly

(other: RGBA) => boolean

Checks if this RGBA instance is equal to another RGBA instance.

fromRGBA

static

readonly

(r: number, g: number, b: number, a: number) => RGBA

Creates an RGBA instance from individual RGBA components.

fromString

static

readonly

(s: string) => RGBA

Creates an RGBA instance from a string representation.

green

readonly

number

Gets the green component of the color.

red

readonly

number

Gets the red component of the color.

toString

readonly

() => string

Returns the string representation of the color.

value

readonly

number