Colours for e-paper, which land on the same grey on any monochrome panel and keep a hue on a colour panel.
(map (comp cc/hex :colour) (palette)) ; four colours, ready to use
(at-shade "#0072b2" 5) ; one of your own, on a grey
An E Ink panel shows 16 greys, its shades, so a device turns a colour into a grey by a conversion it doesn't document (see greyscale), and then into 4 bits. Engines floor or round to 8 bits. After that, some devices round to the nearest of #000000, #111111 … #ffffff, and others keep the top 4 bits. A colour has a shade when it lands on the same grey by every conversion and each of those ways of reducing it. Other colours may shift between shades on different devices, or dither into a stipple on those that dither.
By default a colour's shade holds on any e-reader, since these functions ask for every conversion. If you know your device's conversion, pass it to allow more chroma, e.g. (at-shade x 5 [:rec601]). A shade ignores alpha, so it holds only for an opaque colour.
A grey on its shade's own value, e.g. #555555, is a flat tone wherever a device rounds or uses an ordered dither. Rockchip's error diffusion keeps the low 4 bits as its error, so no grey but black and white is flat on all of them.
https://www.eink.com/brand/detail/Kaleido3 https://shopkits.eink.com/en/product/detail/13.3''Kaleido3ePaperDisplay https://github.com/TinkerBoard-Android/rockchip-android-hardware-rk35-einkhwc https://github.com/koreader/koreader-base/blob/master/ffi/blitbuffer.lua
Colours for e-paper, which land on the same grey on any monochrome panel
and keep a hue on a colour panel.
(map (comp cc/hex :colour) (palette)) ; four colours, ready to use
(at-shade "#0072b2" 5) ; one of your own, on a grey
An E Ink panel shows 16 greys, its shades, so a device turns a colour into a
grey by a conversion it doesn't document (see greyscale), and then into 4
bits. Engines floor or round to 8 bits. After that, some devices round to the
nearest of #000000, #111111 … #ffffff, and others keep the top 4 bits. A
colour has a shade when it lands on the same grey by every conversion and
each of those ways of reducing it. Other colours may shift between shades on
different devices, or dither into a stipple on those that dither.
By default a colour's shade holds on any e-reader, since these functions ask
for every conversion. If you know your device's conversion, pass it to allow
more chroma, e.g. (at-shade x 5 [:rec601]). A shade ignores alpha, so it holds
only for an opaque colour.
A grey on its shade's own value, e.g. #555555, is a flat tone wherever a
device rounds or uses an ordered dither. Rockchip's error diffusion keeps
the low 4 bits as its error, so no grey but black and white is flat on all
of them.
https://www.eink.com/brand/detail/Kaleido3
https://shopkits.eink.com/en/product/detail/13.3''Kaleido3ePaperDisplay
https://github.com/TinkerBoard-Android/rockchip-android-hardware-rk35-einkhwc
https://github.com/koreader/koreader-base/blob/master/ffi/blitbuffer.lua(at-shade x n)(at-shade x n ks)The colour x on the shade n, in sRGB, keeping its hue in OKLCH and as
much of its chroma as lets it land there by each conversion in ks, by
default all of them. A colour already on the shade stays as it is.
For the most chroma of a hue, give it a vivid colour, e.g. oklch(50% 0.4 258), though muted colours look better on large areas.
The colour `x` on the shade `n`, in sRGB, keeping its hue in OKLCH and as much of its chroma as lets it land there by each conversion in `ks`, by default all of them. A colour already on the shade stays as it is. For the most chroma of a hue, give it a vivid colour, e.g. oklch(50% 0.4 258), though muted colours look better on large areas.
The hues that palette takes by default, in the order to use them, so that as many as you take from the front stay apart. Each is a map of its :name, a :colour, which gives it its hue and chroma, and its :shade.
The hues that palette takes by default, in the order to use them, so that as many as you take from the front stay apart. Each is a map of its :name, a :colour, which gives it its hue and chroma, and its :shade.
(landings x)(landings x ks)A map of each conversion in ks, by default all of them, to the shades
that the colour x lands on by it.
A map of each conversion in `ks`, by default all of them, to the shades that the colour `x` lands on by it.
(least-gap xs)(least-gap xs ks)The fewest shades between any two colours of xs, wherever each lands by
the conversions in ks, by default all of them, or nil for fewer than two.
At 0, a pair can look the same on a monochrome panel. Each shade is about 5
of L*, so colours that must be told apart by their grey alone want several
shades between them.
The fewest shades between any two colours of `xs`, wherever each lands by the conversions in `ks`, by default all of them, or nil for fewer than two. At 0, a pair can look the same on a monochrome panel. Each shade is about 5 of L*, so colours that must be told apart by their grey alone want several shades between them.
(palette)(palette hues)(palette hues ks)The colours of the hues, by default those of hues, on e-paper by each
conversion in ks, by default all of them. Each colour is a map of these:
Take as many as you need from the front. By default they stay apart on any e-reader, in grey and in colour, and with a colour vision deficiency, which report checks for colours of your own. It skips a hue that has no colour on its shade.
The colours of the `hues`, by default those of hues, on e-paper by each conversion in `ks`, by default all of them. Each colour is a map of these: - :name and :shade, those of the hue - :colour, for lines and fills, which needs a black outline or a large area on the light shades, where it's pale against white - :highlight, the same hue on shade 13, for a background behind black text Take as many as you need from the front. By default they stay apart on any e-reader, in grey and in colour, and with a colour vision deficiency, which report checks for colours of your own. It skips a hue that has no colour on its shade.
The numbers that simulate takes for each panel:
The numbers for :kaleido-3 are estimates, good for comparing colours and no more. A panel is a plain map, so you can pass your own measurements.
The numbers that simulate takes for each panel: - :contrast, the ratio of its white to its black - :saturation, the share of a colour's saturation that it keeps, 0 for a monochrome panel The numbers for :kaleido-3 are estimates, good for comparing colours and no more. A panel is a plain map, so you can pass your own measurements.
(ratio a b)(ratio a b panel)(ratio a b panel conversion)The contrast ratio of the colours a and b as the panel, by default
:carta, shows them by the conversion, by default
greyscale/default-conversion. It uses WCAG's formula, which allows for a
screen's flare, so it's on the cautious side: black on white is 9 on a panel
with a contrast of 15.
The contrast ratio of the colours `a` and `b` as the `panel`, by default :carta, shows them by the `conversion`, by default greyscale/default-conversion. It uses WCAG's formula, which allows for a screen's flare, so it's on the cautious side: black on white is 9 on a panel with a contrast of 15.
(report xs)(report xs ks)Whether the colours xs stay apart on e-paper, by each conversion in ks,
by default all of them, as a map for each check:
A non-colour in xs lands on no grey, so it fails :on-a-shade.
Whether the colours `xs` stay apart on e-paper, by each conversion in `ks`, by default all of them, as a map for each check: - :check, one of :on-a-shade, how many of them land on one grey, :gap, the least-gap between them, or their least ΔEOK as each of :normal, :protan, :deutan and :tritan vision and :kaleido-3 show them - :value, and :wants, the least that it should be - :ok?, whether it is A non-colour in `xs` lands on no grey, so it fails :on-a-shade.
(same-grey? a b)(same-grey? a b ks)Whether the colours a and b land alike by each conversion in ks, by
default all of them, and each way of reducing a grey to 4 bits, e.g. to paint
a grey drawing without changing it on a monochrome panel.
This asks more than having the same shades. A grey off the 16 even values can round to one shade and truncate to the next, e.g. #d4d4d4, and a colour has to do the same.
Whether the colours `a` and `b` land alike by each conversion in `ks`, by default all of them, and each way of reducing a grey to 4 bits, e.g. to paint a grey drawing without changing it on a monochrome panel. This asks more than having the same shades. A grey off the 16 even values can round to one shade and truncate to the next, e.g. #d4d4d4, and a colour has to do the same.
(shade x)(shade x ks)The one shade that the colour x lands on, by each conversion in ks, by
default all of them, or nil where it can land on more than one, e.g. 5 for
#355b92 and nil for #0072b2.
The one shade that the colour `x` lands on, by each conversion in `ks`, by default all of them, or nil where it can land on more than one, e.g. 5 for #355b92 and nil for #0072b2.
(shade->grey n)The grey of the shade n, in sRGB.
The grey of the shade `n`, in sRGB.
(shade? n)Whether n is a shade: a whole number from 0 for black to 15 for white.
Whether `n` is a shade: a whole number from 0 for black to 15 for white.
(shades x)(shades x ks)The shades that the colour x can land on, by each conversion in ks, by
default all of them, and each way of reducing a grey to 4 bits, as a sorted
set.
The shades that the colour `x` can land on, by each conversion in `ks`, by default all of them, and each way of reducing a grey to 4 bits, as a sorted set.
(simulate x)(simulate x panel)(simulate x panel conversion)The colour x as the panel, by default :carta, shows it by the
conversion, by default greyscale/default-conversion, relative to the panel's
white, in linear sRGB.
A panel is a key of panels or a map like them. On a monochrome panel, the conversion turns the colour into a grey. A colour panel reduces each channel to 16 values instead, which is why Kaleido 3 has 4,096 colours. Reflectance follows the linear light of sRGB, whose curve is close to the gamma of 2.2 that SiPix's patent aims for. This is an approximation, for comparing colours. https://patents.google.com/patent/US8456414
The colour `x` as the `panel`, by default :carta, shows it by the `conversion`, by default greyscale/default-conversion, relative to the panel's white, in linear sRGB. A panel is a key of panels or a map like them. On a monochrome panel, the conversion turns the colour into a grey. A colour panel reduces each channel to 16 values instead, which is why Kaleido 3 has 4,096 colours. Reflectance follows the linear light of sRGB, whose curve is close to the gamma of 2.2 that SiPix's patent aims for. This is an approximation, for comparing colours. https://patents.google.com/patent/US8456414
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 |