Class Color

The color class

Hierarchy

  • Color

Constructors

Properties

a: number
b: number
g: number
r: number
BLACK: Color = ...
BLUE: Color = ...
CYAN: Color = ...
GREEN: Color = ...
MAGENTA: Color = ...
RED: Color = ...
TRANSPARENT: Color = ...
WHITE: Color = ...
YELLOW: Color = ...

Methods

  • Returns an array of the colour values [r, g, b, a]

    Returns number[]

  • Creates a Color object from a hex value

    Parameters

    • hex: string

      The hex value of the colour

    • alpha: number = 255

      The alpha value of the colour

    Returns Color

    A Color Object

  • Interpolates between two colors

    Parameters

    • color1: Color

      the first color

    • color2: Color

      the second color

    • t: number

      amount to interpolate by (a number between 0 and 1)

    Returns Color

    The interpolated color

  • Converts the color to a hex value

    Parameters

    • color: Color

      The color to convert to hex

    Returns string

    The hex value

Generated using TypeDoc