Skip to content

Add generalised color vision deficiency support

Philip requested to merge phikal/modus-themes:cvd-support into main

This option merges all CVD needs into a single variable, that skews the default colours for Modus Operandi and Vivendi, to better suit their needs. This is done by introducing the general concept of a palette filter (modus-theme--palette-filter) that is called before modus-themes--palette generates the palette for a given theme.


This is related to the issue #258 (closed).

On the topic of performance, you can test the core functionality with

;; Tested on Emacs 28 without native compilation, CPU: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
(benchmark-run 1
  (funcall (modus-themes--cvd-filter '(achromatopsia . 0.2)) modus-themes-vivendi-colors))
;; => (0.003418262 0 0.0)

to see that the overhead is minimal (and that only if the option is activated).

The framework would allow for more option to be added in the future, as long as a transformation within the (RGB) colour space can be given.

I have tried to document the option, but I am not sure if it is up to your standards.

Finally, there might be a better name for the option. Do you have any ideas?


Here are a few screenshots demonstrating the effect (the Customize buffer at the top of the window indicated what is currently active):

Screenshot_2021-12-08_23-34-39 Screenshot_2021-12-08_23-34-52

Screenshot_2021-12-08_23-35-17 Screenshot_2021-12-08_23-33-57

Screenshot_2021-12-08_23-34-13

Merge request reports