rhodonite
    Preparing search index...

    Class MutableColorRgba

    A mutable RGBA color class that extends MutableVector4. Represents a color with red, green, blue, and alpha components. This class provides both vector-like (x, y, z, w) and color-specific (r, g, b, a) accessors.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    _v: TypedArray = ...

    Internal typed array storage for vector components

    Accessors

    • get _updateCount(): number

      Gets the update counter value. This counter is incremented whenever the vector is modified.

      Returns number

      The current update count

    • get glslStrAsFloat(): string

      Converts the vector to a GLSL vec4 string representation with float precision.

      Returns string

      A GLSL-compatible vec4 string (e.g., "vec4(1.0, 2.0, 3.0, 4.0)")

    • get glslStrAsInt(): string

      Converts the vector to a GLSL ivec4 string representation with integer values.

      Returns string

      A GLSL-compatible ivec4 string (e.g., "ivec4(1, 2, 3, 4)")

    • get glslStrAsUint(): string

      Converts the vector to a GLSL uvec4 string representation with unsigned integer values.

      Returns string

      A GLSL-compatible uvec4 string (e.g., "uvec4(1u, 2u, 3u, 4u)")

    • get wgslStrAsFloat(): string

      Converts the vector to a WGSL vec4f string representation with float precision.

      Returns string

      A WGSL-compatible vec4f string (e.g., "vec4f(1.0, 2.0, 3.0, 4.0)")

    • get wgslStrAsInt(): string

      Converts the vector to a WGSL vec4i string representation with integer values.

      Returns string

      A WGSL-compatible vec4i string (e.g., "vec4i(1, 2, 3, 4)")

    • get wgslStrAsUint(): string

      Converts the vector to a WGSL vec4u string representation with unsigned integer values.

      Returns string

      A WGSL-compatible vec4u string (e.g., "vec4u(1u, 2u, 3u, 4u)")

    • get compositionType(): CompositionTypeClass<"VEC4">

      Gets the composition type identifier for this vector type.

      Returns CompositionTypeClass<"VEC4">

      The CompositionType.Vec4 identifier

    Methods

    • Checks if this vector is approximately equal to another vector within a specified tolerance.

      Parameters

      • vec: IVector4

        The vector to compare with

      • delta: number = Number.EPSILON

        The tolerance value for comparison (default: Number.EPSILON)

      Returns boolean

      True if the vectors are approximately equal, false otherwise

    • Divides a vector by a scalar value and stores the result in the output vector. If the divisor is zero, the result components will be set to Infinity and an error will be logged. This method modifies the output vector in-place for better performance.

      Parameters

      • vec: IVector4

        The vector to divide

      • value: number

        The scalar value to divide by

      • out: IMutableVector4

        The output vector to store the result (will be modified)

      Returns IMutableVector4

      The modified output vector with each component divided by the scalar

    • Divides the left vector by the right vector component-wise and stores the result in the output vector. If any component of the right vector is zero, the corresponding result component will be set to Infinity. This method modifies the output vector in-place for better performance.

      Parameters

      • l_vec: IVector4

        The left operand vector (dividend)

      • r_vec: IVector4

        The right operand vector (divisor)

      • out: IMutableVector4

        The output vector to store the result (will be modified)

      Returns IMutableVector4

      The modified output vector with component-wise division result