Protected Readonly_The alpha channel. Common to all color spaces.
Protected Readonly_Pointer to concrete color spaces meta-information.
Static ReadonlyMETAThe meta instance.
Get the alpha channel.
The value.
Get the b component.
The b component.
Get the color chroma index. Return null if the color has no chroma component.
The component index.
Get the color space name.
The color space name.
Get the color components as an array of values.
The last element is always the alpha channel.
The other components follow the color space name, e.g.
RGB: [R, G, B, alpha].
The component values.
Get the g component.
The g component.
Get the color hue index. Return null if the color has no hue component (i.e. it is not cylindrical).
The component index.
Get the color lightness index. Return null if the color has no lightness component.
The component index.
Get the r component.
The r component.
Protected Static_Get the tollerance value for achromatic check.
StaticblackStaticgrayThe base gray color in this color space. Standard Web Gray (128, 128, 128). Mathematical center of the 0-255 range.
The gray color.
StaticmiddleThe base perceptual gray color in this color space. Perceptual Middle Gray (L* = 50). In sRGB, 18.4% linear light maps to ~46.6% signal strength. 0.466 * 255 = ~119.
The gray color.
StatictransparentThe base transparent color in this color space. Standard CSS Transparent (Transparent Black).
The transparent color.
StaticwhiteStaticwhiteClip the color to match its HDR range.
The clipped color.
Clip the color to match its SDR range.
The clipped color.
Check whether the color is achromatic. I.e. almost white/black/gray.
Trus if the color is achromatic.
Check whether the color is in a specific color space.
The color space.
True if this is in the color space.
Check whether the color is in a specific color space.
The color space name.
True if this is in the color space.
Check whether the color respects its color space boundaries for HDR.
The check result.
Check whether the color respects its color space boundaries for SDR.
The check result.
Set the alpha component.
The new value.
The new instance with the alpha changed.
Set the component vlaues.
The last one is always the alpha channel.
The other components follow the color space name, e.g.
RGB: [R, G, B, alpha].
The values to set.
A new instance of the target color space.
Converts this color to any other color space.
The class constructor of the target space (e.g., Rgb, Oklch).
A new instance of the target color space.
Get the chroma component value. Return null if the color has no chroma component.
The chroma value.
Get the hue component value. Return null if the color has no hue component.
The hue value.
Get the lightness component value. Return null if the color has no lightness component.
The lightness value.
Set the chroma component value. If null is passed, nothing is done.
The new chroma value.
A new instance of the target color space.
Set the hue component value. If null is passed, nothing is done.
The new hue value.
A new instance of the target color space.
Set the lightness component value. If null is passed, nothing is done.
The new lightness value.
A new instance of the target color space.
StaticequalsStaticfromCreate an instance from its components.
The components.
The new instance.
StaticfromCreate an instance from its JSON representation.
The JSON.
The new instance.
StaticfromStaticfromConvert XYZ components to this color space components.
The XYZ components as [x, y, z, alpha].
The color space components as [r, g, b, alpha].
StatictoConvert source components to destination components.
The source components.
The source components class definition.
The destination components class definition.
The converted components.
StatictoConvert this color space components to XYZ components.
The color space components as [r, g, b, alpha].
The XYZ components as [x, y, z, alpha].
SRGB (Standard RGB). The default color space for the web.
Ranges (Internal):