Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Color3

Represents 3-component color without alpha.

Hierarchy

Index

Constructors

constructor

  • new Color3(r: number, g: number, b: number): Color3
  • constructor for Color3.

    Parameters

    • r: number

      Red value clamped in [0,1]

    • g: number

      Green value clamped in [0,1]

    • b: number

      Blue value clamped in [0,1]

    Returns Color3

Properties

rawElements

rawElements: IArray

Actual array represents components of this instance.

Accessors

B

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

    Returns number

ElementCount

  • get ElementCount(): number

G

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

    Returns number

R

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

    Returns number

magnitude

  • get magnitude(): number

sqrMagnitude

  • get sqrMagnitude(): number

Methods

equalWith

  • equalWith(col: Color3): boolean
  • Compare equality of this instance to the other instance.

    Parameters

    • col: Color3

      the other instance to compare

    Returns boolean

    The result

toDisplayString

  • toDisplayString(): string
  • Expression as string. This will be more human readable format than toString(). May be useful for debugging.

    Returns string

toString

  • toString(): string

toVector

toVector4

  • Convert as Vector4 with given alpha value.

    Parameters

    • Optional a: number

    Returns Vector4

    Converted vector4

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: Color3

      1st value to compare

    • col2: Color3

      2nd value to compare

    Returns boolean

    The result

Static fromColor4

  • Convert Color4 to Color3. Alpha component of given value is ignored.

    Parameters

    Returns Color3

Static internalParse

  • internalParse(color: string, isFirst: boolean, tryParse?: boolean): Color3
  • Internal use. Do not call directry.

    Parameters

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

    Returns Color3

    [description]

Static parse

  • parse(color: string, tryParse?: boolean): Color3
  • Convert string to Color3 instance.

    Parameters

    • color: string

      A string value expressing color3.

    • Optional tryParse: boolean

      Internal use. Please use undefined always.

    Returns Color3

    Converted Color3 value

Generated using TypeDoc