Hierarchy

  • Base
    • Color

Constructors

  • Parameters

    Returns Color

  • Parameters

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

    Returns Color

Properties

b: number = 1
g: number = 1
r: number = 1
NAMES: { aliceblue: number; antiquewhite: number; aqua: number; aquamarine: number; azure: number; beige: number; bisque: number; black: number; blanchedalmond: number; blue: number; blueviolet: number; brown: number; burlywood: number; cadetblue: number; chartreuse: number; chocolate: number; coral: number; cornflowerblue: number; cornsilk: number; crimson: number; cyan: number; darkblue: number; darkcyan: number; darkgoldenrod: number; darkgray: number; darkgreen: number; darkgrey: number; darkkhaki: number; darkmagenta: number; darkolivegreen: number; darkorange: number; darkorchid: number; darkred: number; darksalmon: number; darkseagreen: number; darkslateblue: number; darkslategray: number; darkslategrey: number; darkturquoise: number; darkviolet: number; deeppink: number; deepskyblue: number; dimgray: number; dimgrey: number; dodgerblue: number; firebrick: number; floralwhite: number; forestgreen: number; fuchsia: number; gainsboro: number; ghostwhite: number; gold: number; goldenrod: number; gray: number; green: number; greenyellow: number; grey: number; honeydew: number; hotpink: number; indianred: number; indigo: number; ivory: number; khaki: number; lavender: number; lavenderblush: number; lawngreen: number; lemonchiffon: number; lightblue: number; lightcoral: number; lightcyan: number; lightgoldenrodyellow: number; lightgray: number; lightgreen: number; lightgrey: number; lightpink: number; lightsalmon: number; lightseagreen: number; lightskyblue: number; lightslategray: number; lightslategrey: number; lightsteelblue: number; lightyellow: number; lime: number; limegreen: number; linen: number; magenta: number; maroon: number; mediumaquamarine: number; mediumblue: number; mediumorchid: number; mediumpurple: number; mediumseagreen: number; mediumslateblue: number; mediumspringgreen: number; mediumturquoise: number; mediumvioletred: number; midnightblue: number; mintcream: number; mistyrose: number; moccasin: number; navajowhite: number; navy: number; oldlace: number; olive: number; olivedrab: number; orange: number; orangered: number; orchid: number; palegoldenrod: number; palegreen: number; paleturquoise: number; palevioletred: number; papayawhip: number; peachpuff: number; peru: number; pink: number; plum: number; powderblue: number; purple: number; rebeccapurple: number; red: number; rosybrown: number; royalblue: number; saddlebrown: number; salmon: number; sandybrown: number; seagreen: number; seashell: number; sienna: number; silver: number; skyblue: number; slateblue: number; slategray: number; slategrey: number; snow: number; springgreen: number; steelblue: number; tan: number; teal: number; thistle: number; tomato: number; turquoise: number; violet: number; wheat: number; white: number; whitesmoke: number; yellow: number; yellowgreen: number } = _colorKeywords

Type declaration

  • aliceblue: number
  • antiquewhite: number
  • aqua: number
  • aquamarine: number
  • azure: number
  • beige: number
  • bisque: number
  • black: number
  • blanchedalmond: number
  • blue: number
  • blueviolet: number
  • brown: number
  • burlywood: number
  • cadetblue: number
  • chartreuse: number
  • chocolate: number
  • coral: number
  • cornflowerblue: number
  • cornsilk: number
  • crimson: number
  • cyan: number
  • darkblue: number
  • darkcyan: number
  • darkgoldenrod: number
  • darkgray: number
  • darkgreen: number
  • darkgrey: number
  • darkkhaki: number
  • darkmagenta: number
  • darkolivegreen: number
  • darkorange: number
  • darkorchid: number
  • darkred: number
  • darksalmon: number
  • darkseagreen: number
  • darkslateblue: number
  • darkslategray: number
  • darkslategrey: number
  • darkturquoise: number
  • darkviolet: number
  • deeppink: number
  • deepskyblue: number
  • dimgray: number
  • dimgrey: number
  • dodgerblue: number
  • firebrick: number
  • floralwhite: number
  • forestgreen: number
  • fuchsia: number
  • gainsboro: number
  • ghostwhite: number
  • gold: number
  • goldenrod: number
  • gray: number
  • green: number
  • greenyellow: number
  • grey: number
  • honeydew: number
  • hotpink: number
  • indianred: number
  • indigo: number
  • ivory: number
  • khaki: number
  • lavender: number
  • lavenderblush: number
  • lawngreen: number
  • lemonchiffon: number
  • lightblue: number
  • lightcoral: number
  • lightcyan: number
  • lightgoldenrodyellow: number
  • lightgray: number
  • lightgreen: number
  • lightgrey: number
  • lightpink: number
  • lightsalmon: number
  • lightseagreen: number
  • lightskyblue: number
  • lightslategray: number
  • lightslategrey: number
  • lightsteelblue: number
  • lightyellow: number
  • lime: number
  • limegreen: number
  • linen: number
  • magenta: number
  • maroon: number
  • mediumaquamarine: number
  • mediumblue: number
  • mediumorchid: number
  • mediumpurple: number
  • mediumseagreen: number
  • mediumslateblue: number
  • mediumspringgreen: number
  • mediumturquoise: number
  • mediumvioletred: number
  • midnightblue: number
  • mintcream: number
  • mistyrose: number
  • moccasin: number
  • navajowhite: number
  • navy: number
  • oldlace: number
  • olive: number
  • olivedrab: number
  • orange: number
  • orangered: number
  • orchid: number
  • palegoldenrod: number
  • palegreen: number
  • paleturquoise: number
  • palevioletred: number
  • papayawhip: number
  • peachpuff: number
  • peru: number
  • pink: number
  • plum: number
  • powderblue: number
  • purple: number
  • rebeccapurple: number
  • red: number
  • rosybrown: number
  • royalblue: number
  • saddlebrown: number
  • salmon: number
  • sandybrown: number
  • seagreen: number
  • seashell: number
  • sienna: number
  • silver: number
  • skyblue: number
  • slateblue: number
  • slategray: number
  • slategrey: number
  • snow: number
  • springgreen: number
  • steelblue: number
  • tan: number
  • teal: number
  • thistle: number
  • tomato: number
  • turquoise: number
  • violet: number
  • wheat: number
  • white: number
  • whitesmoke: number
  • yellow: number
  • yellowgreen: number

Accessors

  • get isBox2(): boolean
  • Returns boolean

  • get isBox3(): boolean
  • Returns boolean

  • get isColor(): boolean
  • Returns boolean

  • get isCylindrical(): boolean
  • Returns boolean

  • get isEuler(): boolean
  • Returns boolean

  • get isLine3(): boolean
  • Returns boolean

  • get isMatrix3(): boolean
  • Returns boolean

  • get isMatrix4(): boolean
  • Returns boolean

  • get isPlane(): boolean
  • Returns boolean

  • get isQuaternion(): boolean
  • Returns boolean

  • get isRay(): boolean
  • Returns boolean

  • get isSphere(): boolean
  • Returns boolean

  • get isSpherical(): boolean
  • Returns boolean

  • get isTriangle(): boolean
  • Returns boolean

  • get isVector2(): boolean
  • Returns boolean

  • get isVector3(): boolean
  • Returns boolean

  • get isVector4(): boolean
  • Returns boolean

Methods

  • [iterator](): IterableIterator<number>
  • Returns IterableIterator<number>

  • addScalar(s: number): Color
  • Parameters

    • s: number

    Returns Color

  • convertGammaToLinear(gammaFactor?: number): Color
  • Parameters

    • Optional gammaFactor: number

    Returns Color

  • convertLinearToGamma(gammaFactor?: number): Color
  • Parameters

    • Optional gammaFactor: number

    Returns Color

  • convertLinearToSRGB(): Color
  • convertSRGBToLinear(): Color
  • copyGammaToLinear(color: Color, gammaFactor?: number): Color
  • Parameters

    • color: Color
    • gammaFactor: number = 2.0

    Returns Color

  • copyLinearToGamma(color: Color, gammaFactor?: number): Color
  • Parameters

    • color: Color
    • gammaFactor: number = 2.0

    Returns Color

  • equals(c: Color): boolean
  • Parameters

    Returns boolean

  • fromArray(array: number[], offset?: number): Color
  • Sets this color's red, green and blue value from the provided array or array-like.

    Parameters

    • array: number[]

      the source array or array-like.

    • offset: number = 0

      (optional) offset into the array-like. Default is 0.

    Returns Color

  • Parameters

    • Optional target: HSL

    Returns HSL

  • getHex(): number
  • Returns number

  • getHexString(): string
  • Returns string

  • getStyle(): string
  • Returns string

  • Parameters

    • color: Color
    • alpha: number

    Returns Color

  • Parameters

    • color: Color
    • alpha: number

    Returns Color

  • multiplyScalar(s: number): Color
  • Parameters

    • s: number

    Returns Color

  • offsetHSL(h: number, s: number, l: number): Color
  • Parameters

    • h: number
    • s: number
    • l: number

    Returns Color

  • setColorName(style: string): Color
  • Parameters

    • style: string

    Returns Color

  • setHSL(h: number, s: number, l: number): Color
  • Parameters

    • h: number
    • s: number
    • l: number

    Returns Color

  • setHex(hex: number): Color
  • Parameters

    • hex: number

    Returns Color

  • setRGB(r: number, g: number, b: number): Color
  • Parameters

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

    Returns Color

  • setScalar(scalar: number): Color
  • Parameters

    • scalar: number

    Returns Color

  • setStyle(style: string): Color
  • Parameters

    • style: string

    Returns Color

  • toArray(array?: number[], offset?: number): number[]
  • Returns an array [red, green, blue], or copies red, green and blue into the provided array.

    Returns

    The created or provided array.

    Parameters

    • array: number[] = []

      (optional) array to store the color to. If this is not provided, a new array will be created.

    • offset: number = 0

      (optional) optional offset into the array.

    Returns number[]

  • toJSON(): number
  • Returns number