Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Color4

An immutable four component (RGBA) color.

The color components (r,g,b,a) are in the range 0..1

Note that this class is immutable.

Hierarchy

  • Color4

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Color4(r: number, g: number, b: number, a: number): Color4
  • Creates a color object

    Parameters

    • r: number
    • g: number
    • b: number
    • a: number

    Returns Color4

Properties

Readonly a

a: number

The alpha component of the color. Range: 0..1, where 1 is fully opaque and 0 is fully transparent (invisible)

Readonly b

b: number

The blue component of the color. Range: 0..1

Readonly g

g: number

The green component of the color. Range: 0..1

Readonly r

r: number

The red component of the color. Range: 0..1

Methods

equals

  • Returns true if the colors are equal

    Parameters

    Returns boolean

Static from

  • Creates a Color4 instance from any object with r,g,b,a properties

    Parameters

    Returns Color4

Generated using TypeDoc