MAJOR REVIEW of (setq modus-themes-diffs 'fg-only)
I am just about to push some changes that affect modus-themes-diffs
.
The idea is to make several minor refinements in various faces.
There is, however, one major point I want to highlight: (setq modus-themes-diffs 'fg-only)
. I changed the colour of its added lines
from green to blue and made the value fg-only
an alias of the new
value fg-only-deuteranopia
.
I have been meaning to implement this change for a while now, but wanted
to delay it until after the release of the latest stable version
(1.3.0
).
The reason for this major stylistic change is that I was not satisfied
with the results of (setq modus-themes-diffs 'fg-only)
for Modus
Operandi. More specifically, I do not think that a green foreground can
ever be optimal for accessibility---it is the least used colour in the
themes and it only applies in cases where it should not be problematic.
Green is inherently bad because of the nature of colour luminance. To
make it contrast with the main white background of Modus Operandi, the
maximum value we can use in order to conform with the minimum 7:1
contrast ratio is #006800
, which is not really vivid. Plus, the
actual value that we may use is even darker at #005e00
: we must go
with that one because it can be combined with some shades of gray. What
compounds the problem is green text that is surrounded by either pure
black or shades of gray, as in the case of those diffs. The end result
is simply not good enough as green is too hard to discern, especially at
smaller font sizes.
Consider those findings:
(defalias 'D 'color-distance)
#+CAPTION: Modus Operandi Red, Green, Blue against diff context
| | #000000 | #505050 | #56576d |
|---------+---------+---------+---------|
| #a60000 | 64582 | 60542 | 76605 |
| #005e00 | 35620 | 33040 | 50264 |
| #0000c0 | 111457 | 75655 | 66335 |
#+TBLFM: $2='(D $1 @1$2) :: $3='(D $1 @1$3) :: $4='(D $1 @1$4)
The lower the number, the less desirable it is.
We can see from the table that the best combinations are #505050
for
the diff context, #a60000
for removed lines (same as before), and
#0000c0
for added ones. So we replace green with blue, which has the
added bonus of further improving the themes' performance for red-green
colour deficiency.
Here are some screenshots of what we had before (running in emacs -Q
)
and what is now in the main
branch. Note that when word-wise or
refined diffs are shown, green is not too bad because of the added
background colours. But the above points still stand, as we cannot
assume refined diffs to be always on (for example, I disable them by
default and only toggle them manually).
ENLARGE the images to full size, otherwise the colours look more saturared
The reason I want to share this here is to elicit feedback from users who may have been accustomed to the old style that had red and green lines (the other changes to diff hunk headers, the context, etc. are here to stay, as they eliminate some exaggerations from the previous design).
I also want to hear from you because this change affects Modus Vivendi. Green is perfectly fine against a dark background, but I wanted to retain consistency between the two themes. Thus, I must ask:
-
Do you really want the old red+green combination for
fg-only
? If absolutely yes, I will decouplefg-only-deuteranopia
andfg-only
, though I still express my strong preference against green in this case. -
Anything else?
Those show exactly what we have now (I am only showing word-wise changes for the current diff---again, enlarge the pictures to full size for accurate results):