ArticleslgStudy

science

Oklab color space

Oklab color space is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Oklab color space rather than just read about it. In short: The Oklab color space is a uniform color space for device-independent color designed to improve perceptual uniformity, hue and lightness prediction, color blending, and usability while ensuring numerical stability and ease of implementation. Introduced by Björn Ottosson in December 2020, Oklab and its cylindrical counterpart, Oklch, have been included in the CSS Color Level 4 and Level 5 drafts for device-independen…

Oklab color space — main illustration
Oklab color space — illustration

Key takeaways

  • Oklab color space belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Oklab color space to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Oklab color space from memory before moving on to harder problems.

Reference excerpt

The Oklab color space is a uniform color space for device-independent color designed to improve perceptual uniformity, hue and lightness prediction, color blending, and usability while ensuring numerical stability and ease of implementation. Introduced by Björn Ottosson in December 2020, Oklab and its cylindrical counterpart, Oklch, have been included in the CSS Color Level 4 and Level 5 drafts for device-independent web colors since December 2021. They are supported by recent versions of major web browsers and allow the specification of colors within the DCI-P3 gamut but outside sRGB. Oklab's model is fitted with improved color appearance data: CAM16 data for lightness and chroma, and IPT data for hue. The new fit addresses issues such as unexpected hue and lightness changes in blue colors present in the CIELAB color space, simplifying the creation of color schemes and smoother color gradients. As Ottosson explained, he chose the name Oklab because the model does an OK (adequate) job and is based on the three color-space coordinates L, a, and b.

Coordinates

Oklab uses the same spatial structure as CIELAB, representing color using three components:

L for perceptual lightness, ranging from 0 (pure black) to 1 (reference white, if achromatic), often denoted as a percentage a and b for opponent channels of the four unique hues, unbounded but in practice ranging from −0.5 to +0.5; CSS assigns ±100% to ±0.4 for both a for green (negative) to red (positive) b for blue (negative) to yellow (positive) Like CIELCh, Oklch represents colors using:

L for perceptual lightness C for chroma representing chromatic intensity, with values from 0 (achromatic) with no upper limit, but in practice not exceeding +0.5; CSS treats +0.4 as 100% h for hue angle in a color wheel, typically denoted in decimal degrees

Achromatic colors Neutral greys, pure black and the reference white are achromatic, that is, a=0, b=0, C=0, and h is undefined. Assigning any real value to their hue component has no effect on conversions between color spaces.

Color differences The perceptual color difference in Oklab is calculated as the Euclidean distance between the (L, a, b) coordinates.

Conversions between color spaces

Conversion to and from Oklch Like CIELCh, the Cartesian coordinates a and b are converted to the polar coordinates C and h as follows: C=a2+b2,h=atan2⁡(b,a), and the polar coordinates are converted to the Cartesian coordinates as follows: a=Ccos⁡h,b=Csin⁡h.

Conversion from CIE XYZ Converting from CIE XYZ with a Standard Illuminant D65 involves:

Applying the linear map which converts the XYZ values into a space analogous to the LMS color space:[lms]=𝐌1[XYZ]. Applying a cube root non-linearity: [l′m′s′]=[l1/3m1/3s1/3]. Converting to Oklab with another linear map: [Lab]=𝐌2[l′m′s′]. The linear-map matrices are 𝐌1=[0.8189330101−0.3618667424−0.12885971370.0329845436−0.9293118715−0.03614563870.0482003018−0.2643662691−0.6338517070],𝐌2=[0.2104542553−0.7936177850−0.00407204681.9779984951−2.4285922050−0.45059370990.0259040371−0.7827717662−0.8086757660].

Conversion from sRGB

Converting from sRGB requires first converting from sRGB to CIE XYZ with a Standard Illuminant D65. As the last step of this conversion is a linear map from linear RGB to CIE XYZ, the reference implementation directly employs the multiplied matrix representing the composition of the two linear maps: [lms]=[0.41222147080.53633253630.05144599290.21190349820.68069954510.10739695660.08830246190.28171883760.6299787005][RlinearGlinearBlinear].

Conversion to CIE XYZ and sRGB Converting to CIE XYZ and sRGB simply involves applying the respective inverse functions in reverse order: [l′m′s′]=𝐌2−1[Lab],[lms]=[(l′)3(m′)3(s′)3],[XYZ]=𝐌1−1[lms].

Notes

References

External links OKLCH Color Picker & Converter By Andrey Sitnik & Roman Shamin

Illustrations

Oklab color space illustration
Oklab color space: Oklch color wheel
Oklch color wheel
Oklab color space: Oklab vs. Oklch color spaces. The color bins shown are the ones within the Rec. 2020 gamut (a wide gamut RGB).
Oklab vs. Oklch color spaces. The color bins shown are the ones within the Rec. 2020 gamut (a wide gamut RGB).
Oklab color space: Visualization of linear color values mapping to locations in perceptual color spaces
Visualization of linear color values mapping to locations in perceptual color spaces

Worked examples

Example 1 — a first encounter with Oklab color space

Start with the simplest possible case. Write down what Oklab color space claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Oklab color space before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Oklab color space ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Oklab color space

In research
Oklab color space appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Oklab color space in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Oklab color space is common in secondary-school and first-year university syllabi. It links to neighbouring topics 2020 introductions, Color appearance models, Color space, so understanding it makes those chapters shorter.
In everyday life
Look for Oklab color space outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Oklab color space” →

How to study Oklab color space in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Oklab color space means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Oklab color space out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Oklab color space in simple terms?

The Oklab color space is a uniform color space for device-independent color designed to improve perceptual uniformity, hue and lightness prediction, color blending, and usability while ensuring numerical stability and ease of implementation. Introduced by Björn Ottosson in December 2020, Oklab and…

Why does Oklab color space matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Oklab color space?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Oklab color space.

Tags

  • 2020 introductions
  • Color appearance models
  • Color space

Keep exploring