Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Color4

Represents 4-components color.

Hierarchy

Index

Constructors

constructor

  • new Color4(r: number, g: number, b: number, a: number): Color4
  • Constructor for Color4.

    Parameters

    • r: number

      Red component value clamped in [0,1]

    • g: number

      Green component value clamped in [0,1]

    • b: number

      Blue component value clamped in [0,1]

    • a: number

      Alpha component value clamped in [0,1]

    Returns Color4

Properties

rawElements

rawElements: IArray

Actual array represents components of this instance.

Accessors

A

  • get A(): number
  • Alpha component value clamped in [0,1]

    Returns number

B

  • get B(): number
  • Blue component value clamped in [0,1]

    Returns number

ElementCount

  • get ElementCount(): number

G

  • get G(): number
  • Green component value clamped in [0,1]

    Returns number

R

  • get R(): number
  • Red component value clamped in [0,1]

    Returns number

magnitude

  • get magnitude(): number

sqrMagnitude

  • get sqrMagnitude(): number

Methods

equalWith

  • equalWith(col: Color4): boolean
  • Compare this instance and the other instance.

    Parameters

    • col: Color4

      the other instance

    Returns boolean

    the result

toDisplayString

  • toDisplayString(): string
  • Convert color4 to string expression. This is more human readable expression than toString().

    Returns string

toString

  • toString(): string
  • Convert color4 to string expression

    Returns string

toVector

Static Protected ___elementEquals

Static Protected ___fromGenerationFunction

  • ___fromGenerationFunction<T>(v1: T, v2: T, gen: function): IArray

Static Protected ___nearlyElementEquals

Static Protected ___parse

Static equals

  • Returns whether the given 2 values are equal or not.

    Parameters

    • col1: Color4

      1st value to compare

    • col2: Color4

      2nd value to compare

    Returns boolean

    The result

Static internalParse

  • internalParse(color: string, isFirst: boolean, tryParse?: boolean): Color4
  • Internal use. Do not call this manually.

    Parameters

    • color: string
    • isFirst: boolean
    • Optional tryParse: boolean

    Returns Color4

Static parse

  • parse(color: string, tryParse?: boolean): Color4
  • Parse string as Color4

    Parameters

    • color: string

      Expression of Color4

    • Optional tryParse: boolean

      Internal use. Please use undefined always.

    Returns Color4

    Instance of Color4 generated by the expression.

Generated using TypeDoc