A color value. Tha value of each component r, g, b, a is specified between [0, 1].

Methods that manipulate values are generally destructive. To preserve the original values, explicitly call clone() to create a duplicate instance.

Hierarchy

  • Color

Constructors

Properties

a b g r

Methods

Constructors

  • Instantiate the color value with all component 0.

    Returns Color

  • Instantiate the color value with specified component value r, g, and b. a is set to 1.

    Parameters

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

    Returns Color

  • Instantiate the color value with specified component value r, g, b and a.

    Parameters

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

    Returns Color

Properties

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

Methods

  • Clones the instance.

    Returns Color

  • Compares the vector to v, and returns true if they are approximately equal.

    Parameters

    Returns boolean

  • Calculates the linear interpolation (lerp) between the current value and c, using t as the interpolation factor, then updates the vector's value to the result.

    Parameters

    • c: Color
    • t: number

      The interpolation factor, specified as a number between [0, 1].

    Returns Color

  • Sets the color's component values to those specified in r, g, b and a.

    Parameters

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

    Returns Color

  • Sets RGB value based on HSV component values. a value does not change by this method.

    Each value h, s, v should be between [0, 1].

    Parameters

    • h: number
    • s: number
    • v: number

    Returns Color

Generated using TypeDoc