wima
    Preparing search index...

    Class ClearColor

    A color manipulation class.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    a: number
    b: number
    g: number
    r: number
    BLACK: Color

    A black color constant.

    BLUE: Color

    A blue color constant.

    CYAN: Color

    A cyan color constant.

    GREEN: Color

    A green color constant.

    PURPLE: Color

    A purple color constant.

    RED: Color

    A red color constant.

    WHITE: Color

    A white color constant.

    YELLOW: Color

    A yellow color constant.

    Methods

    • Allows for iteration of components.

      Returns IterableIterator<number>

    • Blend this color with the given one using addition.

      Parameters

      Returns Color

      A new color instance.

    • Create a new copy of this color object.

      Returns Color

      Reference to the newly cloned object.

    • Copy a color object or CSS color into this one.

      Parameters

      Returns this

      This color instance.

    • Darken this color value by 0..1.

      Parameters

      • scale: number

      Returns Color

      A new color instance.

    • Compare this color with another one using a tolerance.

      Parameters

      • color: Color
      • Optionaltolerance: number

        Maximum allowed per-channel difference.

      Returns boolean

      Whether all components are approximately equal.

    • 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

      A new color instance.

    • Lighten this color value by 0..1.

      Parameters

      • scale: number

      Returns Color

      A new color instance.

    • Generate random r,g,b values for this color object.

      Returns Color

    • Convert this color into plain serializable data.

      Returns ColorLike

      A plain color object.

    • 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

        Alpha value [0.0 .. 1.0].

      Returns this

      This color instance.

    • Parameters

      Returns typeof Color

    • Compare two colors using a tolerance.

      Parameters

      • color1: Color
      • color2: Color
      • Optionaltolerance: number

        Maximum allowed per-channel difference.

      Returns boolean

      Whether all components are approximately equal.

    • Parameters

      • r: number
      • g: number
      • b: number
      • a: number
      • Optionalcolor: Color

      Returns Color

    • Check whether a value matches the serialized color shape.

      Parameters

      • value: unknown

        Value to validate.

      Returns value is ColorLike

      Whether the value is a valid serialized color.