Expand description
§Color Module
This module provides types for working with colors in different color spaces. It supports sRGB, Display P3, and OKLCH color spaces, with utilities for conversion and manipulation of color values.
The OKLCH color space is perceptually uniform and is therefore recommended for most user interface work. By expressing colors in OKLCH you can adjust lightness, chroma, and hue independently while maintaining predictable contrast relationships across themes.
The primary type is Color, which can represent colors in sRGB, Display P3,
or OKLCH color spaces, with conversion methods from various tuple formats.
Structs§
- Amber
- Amber color.
- Blue
- Blue color.
- Blue
Grey - Blue grey color.
- Brown
- Brown color.
- Color
- A color value that can be resolved in different color spaces.
- Cyan
- Cyan color.
- Deep
Orange - Deep orange color.
- Deep
Purple - Deep purple color.
- Green
- Green color.
- Grey
- Grey color.
- Indigo
- Indigo color.
- Light
Blue - Light blue color.
- Light
Green - Light green color.
- Lime
- Lime color.
- Oklch
- Represents a color in the perceptually-uniform OKLCH color space.
- Orange
- Orange color.
- P3
- Represents a color in the Display P3 color space.
- Pink
- Pink color.
- Purple
- Purple color.
- Red
- Red color.
- Resolved
Color - Represents a resolved color in linear sRGB color space with extended range support.
- Srgb
- Represents a color in the sRGB color space.
- Teal
- Teal color.
- With
Opacity - Represents a color with an opacity/alpha value applied.
- Yellow
- Yellow color.
Enums§
- Colorspace
- Represents the supported color spaces for color representation.
- HexColor
Error - Errors that can occur when parsing hexadecimal color strings.