Hilo3d API - v2.0.0
    Preparing search index...

    Class Color

    颜色类

    Hierarchy (View Summary)

    Index
    className: string = 'Color'

    类名

    elements: vec4
    isColor: boolean = true
    isVector4: boolean = true
    • get w(): number

      W component

      Returns number

    • set w(value: number): void

      W component

      Parameters

      • value: number

      Returns void

    • get x(): number

      X component

      Returns number

    • set x(value: number): void

      X component

      Parameters

      • value: number

      Returns void

    • get y(): number

      Y component

      Returns number

    • set y(value: number): void

      Y component

      Parameters

      • value: number

      Returns void

    • get z(): number

      Z component

      Returns number

    • set z(value: number): void

      Z component

      Parameters

      • value: number

      Returns void

    • Returns whether or not the vectors have approximately the same elements in the same position.

      Parameters

      • a: Vector4
      • Optionalb: Vector4

        如果不传,计算 this 和 a 的结果

      Returns boolean

      True if the vectors are equal, false otherwise.

    • Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)

      Parameters

      • a: Vector4
      • Optionalb: Vector4

        如果不传,计算 this 和 a 的结果

      Returns boolean

      True if the vectors are equal, false otherwise.

    • 从数组赋值

      Parameters

      • array: ArrayLike<number>

        数组

      • offset: number = 0

        数组偏移值

      Returns this

    • 从十六进制值赋值

      Parameters

      • hex: string | number

        颜色的十六进制值,可以以下形式:"#ff9966", "ff9966", "#f96", "f96", 0xff9966

      Returns this

    • 从数组赋值

      Parameters

      • array: ArrayLike<number>

        数组

      • offset: number = 0

        数组偏移值

      Returns this

    • Performs a linear interpolation between two vec4's

      Parameters

      • v: Vector4
      • t: number

        interpolation amount between the two vectors

      Returns this

      this

    • Generates a random vector with the given scale

      Parameters

      • Optionalscale: number

        Length of the resulting vector. If ommitted, a unit vector will be returned

      Returns this

      this

    • Scales this by a scalar number

      Parameters

      • scale: number

        amount to scale the vector by

      Returns this

      this

    • Adds two vec4's after scaling the second vector by a scalar value

      Parameters

      • scale: number

        the amount to scale the second vector by before adding

      • a: Vector4
      • Optionalb: Vector4

        如果不传,计算 this 和 a 的结果

      Returns this

      this

    • Set the components of a vec4 to the given values

      Parameters

      • x: number

        X component

      • y: number

        Y component

      • z: number

        Z component

      • w: number

        W component

      Returns this

      this

    • 转换到数组

      Parameters

      • array: number[] = []

        转换到的数组

      • offset: number = 0

        数组偏移值

      Returns number[]