Cluster Creator Kit Script Reference
    Preparing search index...

    Class Color

    A color value. Tha value of each component r, g, b, a is specified between [0, 1].

    Methods that manipulate values are generally destructive. To preserve the original values, explicitly call clone() to create a duplicate instance.

    Index

    Constructors

    Properties

    a b g r

    Methods

    Constructors

    • Creates an instance with all components initialized to 0.

      Returns Color

    • Creates an instance with the specified r, g, and b component values. a is set to 1.

      Parameters

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

      Returns Color

    • Instantiate the color value with specified component value r, g, b and a.

      Parameters

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

      Returns Color

    Properties

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

    Methods

    • Compares the vector to v, and returns true if they are approximately equal.

      Parameters

      Returns boolean

    • Calculates the linear interpolation (lerp) between the current value and c, using t as the interpolation factor, then updates the vector's value to the result.

      Parameters

      • c: Color
      • t: number

        The interpolation factor, specified as a number between [0, 1].

      Returns this

    • Sets the color's component values to those specified in r, g, b and a.

      Parameters

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

      Returns this

    • Sets RGB value based on HSV component values. a value does not change by this method.

      Each value h, s, v should be between [0, 1].

      Parameters

      • h: number
      • s: number
      • v: number

      Returns this