wima
    Preparing search index...

    Class Color

    A color manipulation class.

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • r: number = 1

        The red channel [0 .. 1].

      • g: number = 1

        The green channel [0 .. 1].

      • b: number = 1

        The blue channe; [0 .. 1].

      • alpha: number = 1

        The alpha channel [0 .. 1].

      Returns Color

    Properties

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

    Methods

    • Allows for iteration of components.

      Returns Generator<number, void, unknown>

    • Darken this color value by 0..1.

      Parameters

      • scale: number

      Returns Color

      Reference to this object for method chaining.

    • Linearly interpolate between this color and the given one.

      Parameters

      • color: Color
      • alpha: number

        With alpha = 0 being this color, and alpha = 1 being the given one.

      Returns Color

      Reference to this object for method chaining.

    • Set this color to the specified value.

      Parameters

      • r: number

        Red component [0 .. 255].

      • g: number

        Green component [0 .. 255].

      • b: number

        Blue component [0 .. 255].

      • Optionalalpha: number = 1.0

        Alpha value [0.0 .. 1.0].

      Returns Color

      Reference to this object for method chaining.