[go: up one dir, main page]

Module color

Source
Expand description

General color-parsing utilities, independent on the specific color storage and parsing implementation.

For a more complete css-color implementation take a look at cssparser-color crate, or at Gecko’s color module.

Enums§

PredefinedColorSpace
A Predefined color space specified in: https://drafts.csswg.org/css-color-4/#predefined

Constants§

OPAQUE
The opaque alpha value of 1.0.

Functions§

all_named_colors
Returns an iterator over all named CSS colors. https://drafts.csswg.org/css-color-4/#typedef-named-color
clamp_floor_256_f32
Round and clamp a single number to a u8.
clamp_unit_f32
Clamp a 0..1 number to a 0..255 range to u8.
parse_hash_color
Parse a color hash, without the leading ‘#’ character.
parse_named_color
Returns the named color with the given name. https://drafts.csswg.org/css-color-4/#typedef-named-color
serialize_color_alpha
Serialize the alpha copmonent of a color according to the specification. https://drafts.csswg.org/css-color-4/#serializing-alpha-values