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.
Modules§
Structs§
Enums§
- A Predefined color space specified in: https://drafts.csswg.org/css-color-4/#predefined
Constants§
- The opaque alpha value of 1.0.
Statics§
- MAP 🔒
Functions§
- Returns an iterator over all named CSS colors. https://drafts.csswg.org/css-color-4/#typedef-named-color
- Round and clamp a single number to a u8.
- Clamp a 0..1 number to a 0..255 range to u8.
- from_
hex 🔒 - Parse a color hash, without the leading ‘#’ character.
- Returns the named color with the given name. https://drafts.csswg.org/css-color-4/#typedef-named-color
- Serialize the alpha copmonent of a color according to the specification. https://drafts.csswg.org/css-color-4/#serializing-alpha-values