Class Color

Describes a color in the from of RGBA (in order: R, G, B, A).

Hierarchy

  • Color

Constructors

  • Constructor of Color.

    Parameters

    • r: number = 1

      The red component of the color

    • g: number = 1

      The green component of the color

    • b: number = 1

      The blue component of the color

    • a: number = 1

      The alpha component of the color

    Returns Color

Properties

a: number

The alpha component of the color, 0~1.

b: number

The blue component of the color, 0~1.

g: number

The green component of the color, 0~1.

r: number

The red component of the color, 0~1.

Methods

  • Determines the sum of this color and the specified color.

    Returns

    The added color

    Parameters

    • color: Color

      The specified color

    Returns Color

  • Scale this color by the given value.

    Returns

    The scaled color

    Parameters

    • s: number

      The amount by which to scale the color

    Returns Color

  • Set the value of this color.

    Returns

    This color.

    Parameters

    • r: number

      The red component of the color

    • g: number

      The green component of the color

    • b: number

      The blue component of the color

    • a: number

      The alpha component of the color

    Returns Color

  • Modify components (r, g, b) of this color from linear space to gamma space.

    Returns

    The color in gamma space

    Parameters

    • out: Color

      The color in gamma space

    Returns Color

  • Modify components (r, g, b) of this color from gamma space to linear space.

    Returns

    The color in linear space

    Parameters

    • out: Color

      The color in linear space

    Returns Color

  • Determines whether the specified colors are equals.

    Returns

    True if the specified colors are equals, false otherwise

    Parameters

    • left: Color

      The first color to compare

    • right: Color

      The second color to compare

    Returns boolean

  • Modify a value from the gamma space to the linear space.

    Returns

    The value in linear space

    Parameters

    • value: number

      The value in gamma space

    Returns number

  • Modify a value from the linear space to the gamma space.

    Returns

    The value in gamma space

    Parameters

    • value: number

      The value in linear space

    Returns number

  • Scale a color by the given value.

    Returns

    The scaled color

    Parameters

    • left: Color

      The color to scale

    • s: number

      The amount by which to scale the color

    • out: Color

      The scaled color

    Returns Color

Generated using TypeDoc