Class SRGBColorTextureProperty

The SRGBColorTextureProperty implements a texture property of a SRGB color. The class follows the 'copy-on-write' pattern, which means that every operation returns a copy of the property with updated values. It also implies that the values of the property cannot be directly modified.

The concept of immutability improves sharing of objects as all types in TypeScript are assigned by identity, instead of by-value (e.g. a copy) as in other programming languages like C.

Constructors

Properties

_factor: SRGBColor

Accessors

  • get factor(): SRGBColor
  • A factor to be combined with the texture.

    Returns SRGBColor

  • set factor(value): void
  • Parameters

    Returns void

  • get isTextureValid(): boolean
  • Property that returns true if the texture property has a valid texture associated with it.

    Returns boolean

Methods

  • Determines if this SRGBColorTextureProperty instance is equal to the other instance.

    Returns boolean

  • Compares whether both texture properties contains the same values.

    Parameters

    Returns boolean

    True if both properties are equal.

  • Creates a new color texture property with separated RGBA components.

    Parameters

    • r: number

      Red component, in range [0, 1].

    • g: number

      Green component, in range [0, 1].

    • b: number

      Blue component, in range [0, 1].

    • a: number

      Alpha component, in range [0, 1].

    Returns SRGBColorTextureProperty