Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Color3

An immutable three component (RGB) color.

The color components (r,g,b) are in the range 0..1.

Note that this class is immutable.

Hierarchy

  • Color3

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Color3(r: number, g: number, b: number): Color3
  • Creates a color object.

    Parameters

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

    Returns Color3

Properties

Readonly b

b: number

The blue component of the color. Range: 0..1

Readonly g

g: number

The green component of the color. Range: 0..1

Readonly r

r: number

The red component of the color. Range: 0..1

Methods

equals

  • Returns true if the colors are equal.

    Parameters

    Returns boolean

Static from

  • Creates a Color3 instance from any object with r,g,b properties

    Parameters

    Returns Color3

Static fromArray

  • fromArray(arr: ArrayLike<number>): Color3
  • Creates a new Color3 instance from the first 3 elements of the given array.

    Parameters

    • arr: ArrayLike<number>

    Returns Color3

Static fromColor4

  • Creates a Color3 instance from the r,g,b properties of the given RGBA color, ignoring the alpha channel

    Parameters

    Returns Color3

Generated using TypeDoc