Liking cljdoc? Tell your friends :D

dk.simongray.colour-coded.vision

Colours as people with a colour vision deficiency see them, by the model of Machado, Oliveira and Fernandes.

The model shifts how one kind of cone responds to light: the L cones for a protan deficiency, the M cones for a deutan one, and the S cones for a tritan one. Its severity runs from 0, normal colour vision, to 1. At 1, the protan and deutan simulations are those of dichromats, who lack the cone. The paper treats its tritan simulation as an approximation, and doesn't simulate tritanopia, since the causes of tritan deficiencies aren't well known.

Red-green deficiencies, protan and deutan, affect about 8% of men and 0.4% of women of European descent, while tritan ones are much rarer (the paper, after Sharpe et al.).

The paper derives each matrix from the spectra of a display's primaries, so the matrices apply to linear light, and the namespace applies them in linear sRGB.

Machado, Oliveira and Fernandes, A physiologically-based model for simulation of color vision deficiency, IEEE Transactions on Visualization and Computer Graphics 15(6), 2009, pp. 1291–1298 https://www.inf.ufrgs.br/~oliveira/pubs_files/CVD_Simulation/CVD_Simulation.html

Colours as people with a colour vision deficiency see them, by the model
of Machado, Oliveira and Fernandes.

The model shifts how one kind of cone responds to light: the L cones for
a protan deficiency, the M cones for a deutan one, and the S cones for a
tritan one. Its severity runs from 0, normal colour vision, to 1. At 1,
the protan and deutan simulations are those of dichromats, who lack the
cone. The paper treats its tritan simulation as an approximation, and
doesn't simulate tritanopia, since the causes of tritan deficiencies
aren't well known.

Red-green deficiencies, protan and deutan, affect about 8% of men and
0.4% of women of European descent, while tritan ones are much rarer (the
paper, after Sharpe et al.).

The paper derives each matrix from the spectra of a display's primaries,
so the matrices apply to linear light, and the namespace applies them in
linear sRGB.

Machado, Oliveira and Fernandes, A physiologically-based model for
simulation of color vision deficiency, IEEE Transactions on
Visualization and Computer Graphics 15(6), 2009, pp. 1291–1298
https://www.inf.ufrgs.br/~oliveira/pubs_files/CVD_Simulation/CVD_Simulation.html
raw docstring

deficienciesclj/s

The deficiencies that the model simulates.

The deficiencies that the model simulates.
sourceraw docstring

least-differenceclj/s

(least-difference xs)
(least-difference xs severity)

The least ΔEOK between any two colours of xs, with normal colour vision and with each deficiency at the severity, by default 1.

It returns a map of :normal and each deficiency to the least ΔEOK, which is nil for fewer than two colours. A difference of 0.02 is about the least that shows, so colours that people must tell apart need more than that with each deficiency.

The least ΔEOK between any two colours of `xs`, with normal colour
vision and with each deficiency at the `severity`, by default 1.

It returns a map of :normal and each deficiency to the least ΔEOK, which
is nil for fewer than two colours. A difference of 0.02 is about the
least that shows, so colours that people must tell apart need more than
that with each deficiency.
sourceraw docstring

matricesclj/s

The paper's matrices for each deficiency, at the severities from 0 to 1 in steps of 0.1. Each maps a colour's red, green and blue in linear light.

The paper's matrices for each deficiency, at the severities from 0 to 1
in steps of 0.1. Each maps a colour's red, green and blue in linear
light.
sourceraw docstring

matrixclj/s

(matrix deficiency severity)

The matrix that simulates the deficiency at the severity, from 0 to

  1. Between the paper's steps, it interpolates the two nearest matrices, e.g. at 0.873 those of 0.8 and 0.9, weighing the latter by 0.73.
The matrix that simulates the `deficiency` at the `severity`, from 0 to
1. Between the paper's steps, it interpolates the two nearest matrices,
e.g. at 0.873 those of 0.8 and 0.9, weighing the latter by 0.73.
sourceraw docstring

simulateclj/s

(simulate x deficiency)
(simulate x deficiency severity)

The colour x as someone with the deficiency sees it, at the severity from 0 to 1, by default 1, in linear sRGB.

The matrices can take a saturated colour outside sRGB, even to one that no light gives: for a deutan, pure blue gets a negative response of the L cones. The function clips the result to sRGB, where ΔEOK can measure it.

The colour `x` as someone with the `deficiency` sees it, at the
`severity` from 0 to 1, by default 1, in linear sRGB.

The matrices can take a saturated colour outside sRGB, even to one that
no light gives: for a deutan, pure blue gets a negative response of the
L cones. The function clips the result to sRGB, where ΔEOK can measure
it.
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