CSS colours, parsed from the syntax of CSS Color 4 and 5, and serialised by the rules of CSS Color 4.
The parser reads:
It doesn't read relative colours, calc() or system colours. https://www.w3.org/TR/css-color-4/ https://www.w3.org/TR/css-color-5/#color-mix
CSS colours, parsed from the syntax of CSS Color 4 and 5, and serialised by the rules of CSS Color 4. The parser reads: - hex colours, the named colours and transparent - rgb(), rgba(), hsl(), hsla(), hwb(), lab(), lch(), oklab(), oklch() and color(), in the modern syntax and the legacy one with commas, with none for a missing component - color-mix(), of any number of colours It doesn't read relative colours, calc() or system colours. https://www.w3.org/TR/css-color-4/ https://www.w3.org/TR/css-color-5/#color-mix
The degrees in each unit of a CSS angle.
The degrees in each unit of a CSS angle.
The spaces that color() names, by the names it gives them.
The spaces that color() names, by the names it gives them.
The syntax of a component of a colour function: a CSS number, and its unit or percent sign, if any.
The syntax of a component of a colour function: a CSS number, and its unit or percent sign, if any.
(format-number x)(format-number x digits)The number x as a CSS number, rounded to digits significant digits,
by default 6, without trailing zeros, and the same on every platform.
The number `x` as a CSS number, rounded to `digits` significant digits, by default 6, without trailing zeros, and the same on every platform.
The spec of each colour function of CSS, by its name: the space of its colours, and the specs of its components and its alpha, for component to read.
The spec of each colour function of CSS, by its name: the space of its colours, and the specs of its components and its alpha, for component to read.
The spaces that color-mix() interpolates in, by the names it gives them.
The spaces that color-mix() interpolates in, by the names it gives them.
The named colours of CSS Color 4, as hex colours, by their names.
The named colours of CSS Color 4, as hex colours, by their names.
(parse s)The colour of the CSS colour s, e.g. "#24476b", "rebeccapurple" or
"oklch(44% 0.085 158)", as a map of its :space, :coords and :alpha, or
nil when the parser can't read it.
The colour of the CSS colour `s`, e.g. "#24476b", "rebeccapurple" or "oklch(44% 0.085 158)", as a map of its :space, :coords and :alpha, or nil when the parser can't read it.
(parse-hex s)The colour of the CSS hex colour s, e.g. #24476b, #fff or #ffffff80, as
an sRGB colour, or nil when it isn't one.
The colour of the CSS hex colour `s`, e.g. #24476b, #fff or #ffffff80, as an sRGB colour, or nil when it isn't one.
(serialise {:keys [coords alpha] :as colour})The colour, a map of its :space, :coords and :alpha, as CSS:
The `colour`, a map of its :space, :coords and :alpha, as CSS: - sRGB, HSL and HWB as rgb() or rgba(), the legacy form, unless a component is missing - Lab, LCH, Oklab and OKLCH as their own functions - the rest as color()
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |