liveBook · Manning

Rectangular color space

As explained in CSS in Depth, Second Edition

A rectangular color space represents color components as independent coordinates on rectangular axes rather than as angular coordinates.

A rectangular color space represents color components as independent coordinates on rectangular axes. CSS can use one explicitly when interpolating gradient colors with the in keyword. section 13.1.2

CSS-supported rectangular spaces include:

Choosing a gradient space

Use linear-gradient(90deg in oklch, yellow, blue) to change the interpolation space explicitly. For vivid-to-neutral transitions involving gray, black, white, or transparency, a rectangular space such as srgb may produce a better result. Without a specified space, gradients use sRGB. section 13.1.2

How CSS in Depth, Second Edition covers it

How deep it goes
Explains supported spaces and practical gradient selection, but does not detail their coordinate mathematics.
Examples
Uses yellow-to-blue gradients and vivid-to-neutral transitions to compare interpolation behavior.
What you can do after
Apply explicit CSS color-space choices to tune gradient appearance.
How it connects
Connects gradients with color interpolation, color-mix(), sRGB, and polar color spaces.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of CSS in Depth, Second Edition. The section links point to the parts of the book it draws on.