Subject: 29.1; Green is darker with PGTK

From: Peter Oliver <[email-masked]>
Date: Sat, 14 Oct 2023 14:05:20 +0100 (BST)

In X11 Emacs builds, Emacs uses colours as defined by X11.

With PGTK, gdk_rgba_parse is called, which calls pango_color_parse_with_alpha, which uses the colour specifications from CSS (https://www.w3.org/TR/css-color-4/#named-colors).

The CSS colours are almost but not quite the same as the X11 colours (https://en.wikipedia.org/wiki/X11_color_names#Clashes_between_web_and_X11_colors_in_the_CSS_color_scheme discusses this).  Most notably, I find that X11 green is easy to read on a dark background, whereas CSS green is not.

I notice that X.org’s rgb.txt now contains a number of new colours related to this, compared to the rgb.txt bundled with Emacs.  For example:

    0 255   0            green
+  0 255   0            lime
+  0 255   0            x11 green
+  0 255   0            X11Green
+  0 128   0            web green
+  0 128   0            WebGreen

Possible ideas:

- Replace references in the Emacs source code to “green” with “lime”, “purple” with “x11 purple”, etc. (but would this work for users with old X servers?)
- Replace references in the Emacs source code to green with #00ff00, etc.
- Hack function color-values, say, to hard-code green to be #00ff00, etc.

-- 
Peter Oliver