Red channel (0–255).
Green channel (0–255).
Blue channel (0–255).
Optionala: number = 1Alpha channel (0–1).
StaticfromStaticfromThe hex color string.
StaticfromHue, 0–360.
Saturation, 0–100.
Lightness, 0–100.
Optionala: number = 1Alpha, 0–1.
StaticfromStaticfromThe color to compare against.
Optionaltolerance: number = 0Maximum allowed difference per channel.
StaticinterpolateStaticgradientStaticcontrastStaticluminanceStaticbest
Color
Description
Unified color class. Parses any CSS color string (hex, rgb/rgba, hsl/hsla), stores the color internally as RGBA, and provides conversions, interpolation, luminance, and contrast utilities. All channels are kept in sync: setting any of r/g/b/a/h/s/l/hex updates the rest automatically.