[gnome-terminal] Improve contrast in the "GNOME" terminal palette



commit b6282897d3136f8bfd045976a12c84f0c9204e4a
Author: Calvin Walton <calvin walton kepstin ca>
Date:   Sun Apr 26 18:17:32 2020 -0400

    Improve contrast in the "GNOME" terminal palette
    
    After testing the GNOME terminal palette added in
    https://gitlab.gnome.org/GNOME/gnome-terminal/issues/72
    on a wider variety of applications, using a test tool that I developed:
    https://kepstin.pages.gitlab.gnome.org/terminal-palette/
    I have come up with some alterations to the "GNOME" terminal palette
    that aim to improve contrast over the previous revision.
    
    Here's a summary of the changes made, with an explanation for the
    change:
    
    * Reduced the brightness of Black (#0). Perhaps the most noticable
      change. I like the slight purple/blue tint, so I haven't changed it to
      a pure black, but the new shade is a lot darker. This gives room to
      improve the contrast of other colors over the dark background.
    
    * Reduced the brightness of Brown (#3). This color is often used as a
      foreground over the default background, so I have adjusted it to be
      closer to the middle between the dark and light backgrounds.
      The contrast over White goes up from from 3.30 to 4.12 (still AA
      Large). The contrast ratio over Black goes down from 4.83 (AA) to
      4.40 (AA Large).
    
    * Reduced the brightness of Blue (#4). The contrast ratio of Blue over
      Black remains almost the same (2.02 to 2.01). Applications almost
      always request Bright Blue when using blue over the default
      background, because the contrast of Blue over Black is really bad in
      most terminal color schemes. Annoyingly, many existing applications do
      this by requesting Bold Blue, meaning that enabling the "Show bold
      text in bright colors" option is highly recommended when using a dark
      background.
      Reducing the brightness of Blue helps improve contrast when it is used
      as a background color, particularly since some of the bright colors
      also had their brightness reduced (see below).
    
    * Reduced the brightness of Cyan (#6). This color is often used as a
      foreground over the default background. I have adjusted it to increase
      the contrast over the light background from 2.40 (Fail) to 3.07 (AA
      Large). The contrast over dark background goes down from 6.66 to 5.91
      (still AA).
    
    * Reduced the brightness of Light Gray (#7). Light gray was previously
      difficult to distinguish from White when used over a dark background,
      this helps a bit. Contrast vs White incrases from 1.36 to 1.56.
      This color is used the foreground color in the dark scheme, the contrast
      over the default background goes from 11.8 to 11.6 (still AAA).
      The contrast over Blue goes from 5.82 to 5.80 (still AA).
    
    * Increased the brightness of Bright Red (#9).
      Bright Red is occasionally used as a foreground over Blue. The
      previous color had nearly matching luminance, making it hard to read.
      The contrast over Blue increases from 1.92 to 2.90.
      This does reduce the contrast of Bright Red over Bright White from
      4.09 to 3.11 (both AA Large) but that's a pretty rare color
      combination except when "bold is bright" is used.
    
    * Reduced the brightness of Bright Yellow (#11) and Cyan (#14).
      The previous colors were almost completely unreadable against a white
      background, while the new ones are usable by people with good
      eyesight, at least (contrast up from 1.29 and 1.68 to 2.01 and 2.03).
      Applications generally avoid bright yellow and cyan over the default
      background, but it is seen now and then (usually as a side-effect of
      "bold is bright"). The contrast of both colors over dark blue is
      reduced slightly, from AA down to AA Large (4.49 and 4.46 respectively).
    
    * Increased the brightness of Bright Blue (#12).
      Bright Blue is used as a foreground over both dark and light
      backgrounds. I've adjusted the brightness to give it about the same
      contrast level against both Black (#0) and Bright White (#15). Both
      get AA Large (4.30 and 4.21 respectively).
    
    * The remaining colors are unchanged, but due to Black getting darker,
      the contrast of Red, Green, and Purple in particular over Black is
      noticably improved.
    
    On a technical level, I've switched the default palette in the GSettings
    schema to use the colors expressed in hex, so it's easier to check by
    eye if the schema and the code match.

 src/org.gnome.Terminal.gschema.xml | 36 ++++++++++++++++++------------------
 src/profile-editor.c               | 28 ++++++++++++++--------------
 2 files changed, 32 insertions(+), 32 deletions(-)
---
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index 85c388f1f..926be0429 100644
--- a/src/org.gnome.Terminal.gschema.xml
+++ b/src/org.gnome.Terminal.gschema.xml
@@ -135,12 +135,12 @@
       <description>Human-readable name of the profile.</description>
     </key>
     <key name="foreground-color" type="s">
-      <default>'rgb(36,31,49)'</default>
+      <default>'#171421'</default>
       <summary>Default color of text in the terminal</summary>
       <description>Default color of text in the terminal, as a color specification (can be HTML-style hex 
digits, or a color name such as “red”).</description>
     </key>
     <key name="background-color" type="s">
-      <default>'rgb(255,255,255)'</default>
+      <default>'#ffffff'</default>
       <summary>Default color of terminal background</summary>
       <description>Default color of terminal background, as a color specification (can be HTML-style hex 
digits, or a color name such as “red”).</description>
     </key>
@@ -294,22 +294,22 @@
       <description>Run this command in place of the shell, if use_custom_command is true.</description>
     </key>
     <key name="palette" type="as">
-      <default>['rgb(36,31,49)',
-                'rgb(192,28,40)',
-                'rgb(38,162,105)',
-                'rgb(181,131,90)',
-                'rgb(30,80,152)',
-                'rgb(163,71,186)',
-                'rgb(48,183,203)',
-                'rgb(222,221,218)',
-                'rgb(94,92,100)',
-                'rgb(237,51,59)',
-                'rgb(51,209,122)',
-                'rgb(248,228,92)',
-                'rgb(28,113,216)',
-                'rgb(192,97,203)',
-                'rgb(56,218,243)',
-                'rgb(255,255,255)']</default>
+      <default>['#171421',
+                '#c01c28',
+                '#26a269',
+                '#a2734c',
+                '#12488b',
+                '#a347ba',
+                '#2aa1b3',
+                '#d0cfcc',
+                '#5e5c64',
+                '#f66151',
+                '#33da7a',
+                '#e9ad0c',
+                '#2a7bde',
+                '#c061cb',
+                '#33c7de',
+                '#ffffff']</default>
       <summary>Palette for terminal applications</summary>
     </key>
     <key name="font" type="s">
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 320a97856..dbc8c66ac 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -176,13 +176,13 @@ static const TerminalColorScheme color_schemes[] = {
   },
   /* Translators: "GNOME" is the name of a colour scheme, "light" can be translated */
   { N_("GNOME light"),
-    COLOR (0x24, 0x1f, 0x31),  /* Dark 4 */
-    COLOR (0xff, 0xff, 0xff)   /* Light 1 */
+    COLOR (0x17, 0x14, 0x21), /* Palette entry 0 */
+    COLOR (0xff, 0xff, 0xff)  /* Palette entry 15 */
   },
   /* Translators: "GNOME" is the name of a colour scheme, "dark" can be translated */
   { N_("GNOME dark"),
-    COLOR (0xde, 0xdd, 0xda),  /* Light 3 */
-    COLOR (0x24, 0x1f, 0x31)   /* Dark 4 */
+    COLOR (0xd0, 0xcf, 0xcc), /* Palette entry 7 */
+    COLOR (0x17, 0x14, 0x21)  /* Palette entry 0 */
   },
   /* Translators: "Tango" is the name of a colour scheme, "light" can be translated */
   { N_("Tango light"),
@@ -221,23 +221,23 @@ enum
 
 static const GdkRGBA terminal_palettes[TERMINAL_PALETTE_N_BUILTINS][TERMINAL_PALETTE_SIZE] =
 {
-  /* GNOME 3.32 palette: https://developer.gnome.org/hig/stable/icon-design.html.en#palette */
+  /* Based on GNOME 3.32 palette: https://developer.gnome.org/hig/stable/icon-design.html.en#palette */
   {
-    COLOR (0x24, 0x1f, 0x31),  /* Dark 4 */
+    COLOR (0x17, 0x14, 0x21),  /* Blend of Dark 4 and Black */
     COLOR (0xc0, 0x1c, 0x28),  /* Red 4 */
     COLOR (0x26, 0xa2, 0x69),  /* Green 5 */
-    COLOR (0xb5, 0x83, 0x5a),  /* Brown 2 */
-    COLOR (0x1e, 0x50, 0x98),  /* Linear blend 33% Dark 4 over Blue 5 */
+    COLOR (0xa2, 0x73, 0x4c),  /* Blend of Brown 2 and Brown 3 */
+    COLOR (0x12, 0x48, 0x8b),  /* Blend of Blue 5 and Dark 4 */
     COLOR (0xa3, 0x47, 0xba),  /* Purple 3 */
-    COLOR (0x30, 0xb7, 0xcb),  /* Linear addition Blue 5 + Green 5 */
-    COLOR (0xde, 0xdd, 0xda),  /* Light 3 */
+    COLOR (0x2a, 0xa1, 0xb3),  /* Linear addition Blue 5 + Green 5, darkened slightly */
+    COLOR (0xd0, 0xcf, 0xcc),  /* Blend of Light 3 and Light 4 */
     COLOR (0x5e, 0x5c, 0x64),  /* Dark 2 */
-    COLOR (0xed, 0x33, 0x3b),  /* Red 2 */
+    COLOR (0xf6, 0x61, 0x51),  /* Red 1 */
     COLOR (0x33, 0xd1, 0x7a),  /* Green 3 */
-    COLOR (0xf8, 0xe4, 0x5c),  /* Yellow 2 */
-    COLOR (0x1c, 0x71, 0xd8),  /* Blue 4 */
+    COLOR (0xe9, 0xad, 0x0c),  /* Blend of Yellow 4 and Yellow 5 */
+    COLOR (0x2a, 0x7b, 0xde),  /* Blend of Blue 3 and Blue 4 */
     COLOR (0xc0, 0x61, 0xcb),  /* Purple 2 */
-    COLOR (0x38, 0xda, 0xf3),  /* Linear addition Blue 4 + Green 4 */
+    COLOR (0x33, 0xc7, 0xde),  /* Linear addition Blue 4 + Green 4, darkened slightly */
     COLOR (0xff, 0xff, 0xff)   /* Light 1 */
   },
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]