Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Color

Hierarchy

  • Color

Index

Constructors

constructor

  • new Color(r?: number, g?: number, b?: number, a?: number): Color
  • Parameters

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

    Returns Color

Properties

Static BlendType

BlendType: typeof BlendType = ...

Accessors

a

  • get a(): number
  • set a(val: number): void
  • Returns number

  • Parameters

    • val: number

    Returns void

b

  • get b(): number
  • set b(val: number): void
  • Returns number

  • Parameters

    • val: number

    Returns void

g

  • get g(): number
  • set g(val: number): void
  • Returns number

  • Parameters

    • val: number

    Returns void

r

  • get r(): number
  • set r(val: number): void
  • Returns number

  • Parameters

    • val: number

    Returns void

Static BLACK

  • Returns Color

Static TRANSPARENT

  • get TRANSPARENT(): Color
  • Returns Color

Static WHITE

  • Returns Color

Methods

clone

  • Returns Color

equals

  • equals(target: Color): boolean
  • Parameters

    Returns boolean

mix

  • Parameters

    Returns Color

set

  • Parameters

    Returns void

setRGBA

  • setRGBA(r: number, g: number, b: number, a: number): void
  • Parameters

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

    Returns void

setValue32

  • setValue32(v32: number): void
  • Parameters

    • v32: number

    Returns void

toNormalizedArray

  • toNormalizedArray(): [number, number, number, number]
  • Returns [number, number, number, number]

toRGBAString

  • toRGBAString(): string
  • Returns string

Static blendColorHex

  • blendColorHex(colorHexA: number, colorHexB: number, type?: BlendType): number
  • Parameters

    • colorHexA: number
    • colorHexB: number
    • type: BlendType = ...

    Returns number

Static fromFloatArray

  • fromFloatArray(arr: number[]): Color
  • Parameters

    • arr: number[]

    Returns Color

Static fromHex

  • fromHex(hex: number): Color
  • Parameters

    • hex: number

    Returns Color

Static getValue32FromRGBA

  • getValue32FromRGBA(r: number, g: number, b: number, a: number): number
  • Parameters

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

    Returns number

Static multiplyColorHex

  • multiplyColorHex(colorHexA: number, colorHexB: number, type?: BlendType): number
  • Parameters

    • colorHexA: number
    • colorHexB: number
    • type: BlendType = ...

    Returns number

Static randomMix

  • randomMix(colorHexA: number, colorHexB: number, randomSeed?: number): number
  • Parameters

    • colorHexA: number
    • colorHexB: number
    • randomSeed: number = ...

    Returns number

Generated using TypeDoc