Liking cljdoc? Tell your friends :D
All platforms.

dk.simongray.colour-coded.target

Colours found by the contrast that they should have, by the method of Adobe's Leonardo: a search for the lightness at which a colour has the contrast asked for with a background, since the same lightness has a different contrast at each hue. https://github.com/adobe/leonardo

Colours found by the contrast that they should have, by the method of
Adobe's Leonardo: a search for the lightness at which a colour has the
contrast asked for with a background, since the same lightness has a
different contrast at each hue.
https://github.com/adobe/leonardo
raw docstring

at-contrastclj/s

(at-contrast x background r)

The colour x at the OKLCH lightness where its contrast ratio with the background is r, or just over, keeping its hue and as much chroma as sRGB allows, or nil where no lightness reaches r. Of a darker and a lighter answer, it's the one whose lightness is nearer to that of x.

The colour `x` at the OKLCH lightness where its contrast ratio with the
`background` is `r`, or just over, keeping its hue and as much chroma as
sRGB allows, or nil where no lightness reaches `r`. Of a darker and a
lighter answer, it's the one whose lightness is nearer to that of `x`.
sourceraw docstring

scaleclj/s

(scale x background rs)

The colour x at each contrast ratio of rs with the background, as at-contrast finds it, e.g. a ramp of a brand colour from [1.5 3 4.5 7].

The colour `x` at each contrast ratio of `rs` with the `background`, as
at-contrast finds it, e.g. a ramp of a brand colour from [1.5 3 4.5 7].
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close