Module color

Source
Expand description

CSS color values.

Structsยง

Hsl
Color specified by hue, saturation and lightness components.
Hwb
Color specified by hue, whiteness and blackness components.
RGBA
A color with red, green, blue, and alpha components, in a byte each.

Enumsยง

Color
Subset of https://drafts.csswg.org/css-color-4/#color-type

Constantsยง

OPAQUE ๐Ÿ”’

Functionsยง

black ๐Ÿ”’
clamp_floor_256_f32 ๐Ÿ”’
clamp_unit_f32 ๐Ÿ”’
color_to_rgba
map_color_parse_error ๐Ÿ”’
Turn a short-lived [cssparser::ParseError] into a long-lived ParseError.
normalize_hue ๐Ÿ”’
Normalizes h (a hue value in degrees) to be in the interval [0.0, 1.0].
parse_name ๐Ÿ”’
Parse a custom property name.
parse_plain_color ๐Ÿ”’
parse_var_with_fallback ๐Ÿ”’
resolve_alpha ๐Ÿ”’
Takes the opacity property and an alpha value from a CSS <color> and returns a resulting alpha for a computed value.
resolve_color
Resolves a CSS color from itself, an opacity property, and a color property (to resolve currentColor).