Pixen JavaScript API
    Preparing search index...

    Class Color

    An 8-bit RGBA color.

    Index
    • Parameters

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

      Returns Color

    r: number

    The red channel, from 0 through 255.

    g: number

    The green channel, from 0 through 255.

    b: number

    The blue channel, from 0 through 255.

    a: number

    The alpha channel, from 0 through 255.

    hex: string

    The color as #rrggbbaa.

    HSV components with hue 0–360 and saturation/value 0–100.

    • A concise representation suitable for script logs.

      Returns string

    • Compares this color with another accepted color value.

      Parameters

      • color: Color

        A Color or RGBA object.

      Returns boolean

      Whether all four channels match.

    • Composites this color over a background color.

      Parameters

      • background: Color

        A Color or RGBA object.

      Returns Color | null

      The composited color, or null for an invalid value.

    • Parameters

      • value: string

      Returns Color | null

    • Parameters

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

      Returns Color | null