---
source: https://iinventedlight.com/library/notes/css-relative-color.md
title: "CSS relative color syntax: derive a new color from another"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (web.dev); CC-BY-4.0 (Chrome for Developers); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: web.dev, Color; Chrome for Developers, CSS relative color syntax. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-24
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-24
as_of: 2026-11-24
confidence: medium
untested: "Not reproduced (2026-11-24). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: css-relative-color"
tags: [css, color, oklch, relative-color, color-level-5]
client: Librarian
sources:
  - id: S1
    title: "Color"
    publisher: web.dev
    url: https://web.dev/learn/css/color
    accessed: 2026-11-24
    license: "CC-BY-4.0"
  - id: S2
    title: "CSS relative color syntax"
    publisher: Chrome for Developers
    url: https://developer.chrome.com/blog/css-relative-color-syntax
    accessed: 2026-11-24
    license: "CC-BY-4.0"
---
# CSS relative color syntax: derive a new color from another
**Answer:** With relative color syntax, you take any color and perform calculations on it, and that creates a new color.

## The from keyword

The from keyword comes first, then any color in any syntax.

Each channel value is then available as a letter.

The oklch function works with lightness, chroma, and hue channels.

Adjust a channel with calc, or replace the channel completely.

## What authors use it for

CSS Color Level 5 is where this color feature comes from.

You can lighten, darken, saturate, or desaturate the origin color.

OkLCh, the polar or cylindrical form of OKLab, uses Lightness, Chroma, and Hue.

Unlike Display P3, OkLCh is not bounded by a gamut.

Make sure you are making colors that can be displayed.

## See also

- [css-color](https://iinventedlight.com/library/notes/css-color/)
- [css-color-mix](https://iinventedlight.com/library/notes/css-color-mix/)
- [css-custom-properties](https://iinventedlight.com/library/notes/css-custom-properties/)

## Claims

- id: C1
  claim: Relative color syntax starts from a color and computes a new one.
  source: S1
  evidence: "take any color, and perform calculations on it to create a new color"

- id: C2
  claim: The from keyword introduces the origin color.
  source: S1
  evidence: "After the keyword from you can specify any color"

- id: C3
  claim: The syntax is part of CSS Color Level 5.
  source: S2
  evidence: "a very powerful color feature from CSS Color Level 5"

- id: C4
  claim: Authors can lighten, darken, or change opacity with it.
  source: S2
  evidence: "Lighten Darken Saturate"

## Sources

- [S1] Color. web.dev. https://web.dev/learn/css/color . License: CC-BY-4.0. Accessed 2026-11-24.

- [S2] CSS relative color syntax. Chrome for Developers. https://developer.chrome.com/blog/css-relative-color-syntax . License: CC-BY-4.0. Accessed 2026-11-24.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: web.dev, Color; Chrome for Developers, CSS relative color syntax. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
