Represents an RGB color using values ranging from O and 1 for each color component.

Implements

Constructors

  • Create a new instance from either:

    • a (R, G, B) triplet (values ranging from 0 to 1)
    • a 24 bit color value
    • an hexadecimal color string (web style)

    Returns Color

  • Parameters

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

    Returns Color

  • Parameters

    Returns Color

  • Parameters

    • color24: number

    Returns Color

  • Parameters

    • hexColor: string

    Returns Color

Properties

b: number
g: number
r: number
black: Readonly<Color>
blue: Readonly<Color>
brightBlue: Readonly<Color>
brightCyan: Readonly<Color>
brightGreen: Readonly<Color>
brightMagenta: Readonly<Color>
brightOrange: Readonly<Color>
brightPurple: Readonly<Color>
brightRed: Readonly<Color>
brightWhite: Readonly<Color>
brightYellow: Readonly<Color>
cyan: Readonly<Color>
dimBlue: Readonly<Color>
dimCyan: Readonly<Color>
dimGreen: Readonly<Color>
dimMagenta: Readonly<Color>
dimOrange: Readonly<Color>
dimRed: Readonly<Color>
dimWhite: Readonly<Color>
dimYellow: Readonly<Color>
faintWhite: Readonly<Color>
green: Readonly<Color>
magenta: Readonly<Color>
mediumWhite: Readonly<Color>
orange: Readonly<Color>
red: Readonly<Color>
white: Readonly<Color>
yellow: Readonly<Color>

Accessors

  • get bByte(): number
  • Returns number

  • get gByte(): number
  • Returns number

  • get rByte(): number
  • Returns number

Methods

  • Parameters

    Returns Color

  • Returns number

  • Returns Color

  • Parameters

    Returns boolean

  • Parameters

    • dataView: DataView
    • OptionalbyteOffset: number

    Returns [DataView, number]

  • Parameters

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

    Returns Color

  • Parameters

    • rByte: number
    • gByte: number
    • bByte: number

    Returns Color

  • Parameters

    • hexColor: string

    Returns Color

  • Parameters

    • color24: number

    Returns Color

  • Returns number

  • Returns a string representation of an object.

    Returns string

  • Parameters

    • rByte: number
    • gByte: number
    • bByte: number

    Returns Color

  • Parameters

    • hexColor: string

    Returns Color

  • Parameters

    Returns Color