Color Spaces, Conversion, and Output

Choose a color space, convert values, inspect channels, and produce predictable output.

In this chapter

Read in order or jump directly to a specific page.

  1. Choose a color space

    Select a color space according to the operation and output you need.

  2. Convert between spaces

    Convert colors when an operation or consumer requires a different coordinate system, without treating conversion as formatting.

  3. Read color channels

    Convert first, then read channels in a known color space.

  4. Format CSS colors

    Serialize colors in their native or selected CSS syntax.

  5. Generate hexadecimal output

    Choose hexadecimal only when an eight-bit sRGB value matches the consumer's storage and gamut requirements.

  6. Precision and gamut

    Understand output precision and wide-gamut web color formats.