Create a new Color
Red channel (0.0 - 1.0)
Green channel (0.0 - 1.0)
Blue channel (0.0 - 1.0)
Alpha channel (0.0 - 1.0)
Get the color as a Float32Array
The color as an array of floats
Returns a new Color converted from sRGB to Linear space. Often used when passing uniform colors to PBR shaders.
Applies Narkowicz ACES filmic tone mapping approximation to this color and returns a new LDR Color instance. This curves the highlights and shadows to mimic physical film stock.
A new tone-mapped Color
Applies Reinhard tone mapping to this color and returns a new LDR Color instance. Formulated as: C_out = (C_in * exposure) / (1 + C_in * exposure)
Optionalexposure: number = 1.0The exposure value
A new tone-mapped Color
Returns a new Color converted from Linear space to sRGB space.
StaticfromStaticfromCreate a Color from byte values (0 - 255)
Red channel (0 - 255)
Green channel (0 - 255)
Blue channel (0 - 255)
Alpha channel (0 - 255)
A new Color instance
StaticfromCreate a Color from a hex string (e.g. "#FF0000" or "FF0000") or a CSS color name
Hex color string or CSS color name
A new Color instance
Staticlerp
Color representation utilizing RGBA float values ranging from 0.0 to 1.0. Includes helpers to parse hex strings, CSS color names, interpolate colors, and convert to Linear space.