Function Signature
js
oklabToRgb(L: number, a: number, b: number): { r: number, g: number, b: number }Parameters
L(number): OKLab lightness.a(number): OKLab green-red axis.b(number): OKLab blue-yellow axis.
Return Value
An RGB object with integer r, g, and b channels clamped to 0-255.
js
const lab = hexToOklab("#ff6600");
oklabToRgb(lab.L, lab.a, lab.b);
// { r: 255, g: 102, b: 0 }Usage Notes
- Out-of-gamut values are clipped to valid sRGB.
- Pair with
rgbToOklaborhexToOklabfor round-trip conversions.