Skip to main content
InterviewHubPRO
Section Overview
Q24

Question 24 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

48%
CSS3 & Modern Layouts (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)

CSS Color Module Level 4: Wide-Gamut Colors (`oklch()`, `color-mix()`).

senior LevelCode ExampleSystem Design

In Simple Words: Traditional sRGB (hex, rgb(), hsl()) cannot display vivid greens, magentas, and cyans available on modern OLED displays (P3 wide gamut).

  • oklch(L C H):
    • L (Lightness: 0% to 100%), C (Chroma/Saturation), H (Hue angle: 0-360).
    • Perceptually Uniform: Human eyes perceive oklch lightness consistently across different hues (unlike HSL where yellow at 50% lightness looks blindingly bright while blue at 50% looks dark).
  • color-mix(): Natively blends colors in CSS without pre-processors:
    css
    background: color-mix(in oklch, var(--primary) 80%, white);