New diff themes in Gerrit Old UI (Colorblind-friendly!)
I've implemented two new diff themes in Gerrit's old UI. They are meant to
address the following two issues:
1. The default diff theme used in Gerrit places dark red and purple text on
a dark red background (in removed code). This can be hard to read.
Especially on a yellow-tinted monitor (e.g. Red shift, Night shift, Flux,
2. The general use of green/red while readable, is hard to distinguish for
certain types of color-blindness.
This theme adopts the MediaWiki diff styles (yellow and blue). Which means:
* It only colours the background of the intra-line characters that were
* The rest of the line uses a clean white background, thus providing full
colour contrast for all other syntax-highlighted code.
* The boundary of the added/removed blocks is indicated by a border (not by
absence of a background shade).
* The unchanged code lines are lightly shaded in grey (instead of the
default where these lesser important lines are given a bright white
The new UI already has better colour contrast in its diff styles, with
lighter background reds and greens by default.
Unfortunately the new UI has removed both the ability to theme the syntax
highlighting, as well as the ability to theme the diff colours on top of
that. Neither is changeable in the new UI currently.
For the time being I'm a hold out in the old UI as I'm unable to use review
dashboards in the new UI (until we upgrade to 2.16). Meanwhile this is
beneficial to myself and anyone else in a similar hold out.