Colours chosen from among others, e.g. the colours of an image, those that a designer made or the named colours of CSS, and a small scheme for a UI chosen from them.
Colours chosen from among others, e.g. the colours of an image, those that a designer made or the named colours of CSS, and a small scheme for a UI chosen from them.
(chroma x)The chroma of the colour x in OKLCH: 0 for a grey, and about 0.3 at
most in sRGB.
The chroma of the colour `x` in OKLCH: 0 for a grey, and about 0.3 at most in sRGB.
(chromatic? x)(chromatic? x c)Whether the colour x has an OKLCH chroma of at least c, by default
0.04, which off-whites and near-greys don't.
Whether the colour `x` has an OKLCH chroma of at least `c`, by default 0.04, which off-whites and near-greys don't.
(first-with-contrast xs background)(first-with-contrast xs background r)The first colour of xs whose contrast ratio with the background is at
least r, or nil. By default r is 4.5, which WCAG 2.2 asks of text. It
asks 3 of a control. A translucent background lies on white, as in
contrast/ratio.
The first colour of `xs` whose contrast ratio with the `background` is at least `r`, or nil. By default `r` is 4.5, which WCAG 2.2 asks of text. It asks 3 of a control. A translucent `background` lies on white, as in contrast/ratio.
(most-contrast xs background)The colour of xs that contrasts most with the background. A translucent
background lies on white, as in contrast/ratio.
The colour of `xs` that contrasts most with the `background`. A translucent `background` lies on white, as in contrast/ratio.
(nearest x)(nearest x xs)(nearest x xs f)The colour nearest to the colour x among the colours xs, by ΔEOK or by
the measure f, a function of two colours, e.g. difference/delta-e-2000.
Where xs is a map of names to colours, the result is the name of the
nearest one. By default xs is the named colours of CSS, so one argument
returns the name nearest to a colour, e.g. "darkslategrey". No measure is
known to agree best with the names that people give, so ΔEOK is a judgement
there.
The colour nearest to the colour `x` among the colours `xs`, by ΔEOK or by the measure `f`, a function of two colours, e.g. difference/delta-e-2000. Where `xs` is a map of names to colours, the result is the name of the nearest one. By default `xs` is the named colours of CSS, so one argument returns the name nearest to a colour, e.g. "darkslategrey". No measure is known to agree best with the names that people give, so ΔEOK is a judgement there.
(scheme xs)The colours of a UI by the colours xs, which list the most common first,
e.g. those of an image: a map of these, or nil for no colours.
The colours of a UI by the colours `xs`, which list the most common first, e.g. those of an image: a map of these, or nil for no colours. - :background, the most common colour, to tint by - :text, black or white, whichever reads better on the background - :accent, for controls, e.g. a progress bar: the first other colour whose contrast with the background is 3:1, which WCAG 2.2 asks of a control, or else the background's complement in HSL when its contrast is, or else the text colour - :on-accent, black or white, whichever reads better on the accent - :seed, the first colour with a hue, by seed, or nil
(seed xs)The first chromatic colour of xs, which lists the most common first, to
derive the colours of a UI from, or nil where every colour is about grey.
The first chromatic colour of `xs`, which lists the most common first, to derive the colours of a UI from, or nil where every colour is about grey.
(spread xs)(spread xs d)The colours of xs that differ from every colour kept before them by a ΔEOK
of at least d, by default 0.1, which is clearly apart.
The colours of `xs` that differ from every colour kept before them by a ΔEOK of at least `d`, by default 0.1, which is clearly apart.
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 |