Skip to content
colors

rgbToOklab

The `rgbToOklab` function converts RGB channel values to OKLab, a perceptual color space designed for smoother color operations.

1 min read69 words

Function Signature

js

rgbToOklab(r: number, g: number, b: number): { L: number, a: number, b: number }

Parameters

  • r (number): Red channel value.
  • g (number): Green channel value.
  • b (number): Blue channel value.

Return Value

An OKLab object with L, a, and b channels.

js

rgbToOklab(255, 102, 0);
// { L: 0.6958..., a: 0.1775..., b: 0.101... }

Usage Notes

  • Useful for perceptual interpolation and modern color tooling.
  • RGB inputs are clamped to the valid 0-255 range before conversion.

Previous

labToRgb

Next

oklabToRgb


Top-Werkzeuge

BoardlyLinksyChromoCodeHub

ReadyTools

KarriereKontaktWerkzeuge
Preise7 Tage gratis
AnleitungenDocsBlogUpdatesLaraVault

Sprache wählen

Thema wählen

© 2026 ReadyTools. Alle Rechte vorbehalten.