Add generalised color vision deficiency support
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):