Function Signature
js
hexToOklch(hex: string): { L: number, C: number, h: number }Parameters
hex(string): HEX color string in#rgbor#rrggbbformat.
Return Value
An OKLCH object with lightness L, chroma C, and hue h in degrees.
js
hexToOklch("#ff6600");
// { L: 0.6958..., C: 0.2043..., h: 43.49... }Usage Notes
- Useful for building perceptual palettes and modern CSS color declarations.
- Throws if the HEX input is invalid.