[gnome-terminal] profile: editor: Specify color schemes in hex



commit d44eec53ac3bdf94b7bcb8baf7089d2065d2864a
Author: Egmont Koblinger <egmont gmail com>
Date:   Fri Dec 29 21:05:41 2017 +0100

    profile: editor: Specify color schemes in hex
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774619

 src/org.gnome.Terminal.gschema.xml |   32 ++++++++++++++++----------------
 src/profile-editor.c               |   33 ++++++++++++++++-----------------
 2 files changed, 32 insertions(+), 33 deletions(-)
---
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index c8f4c7f..614ce33 100644
--- a/src/org.gnome.Terminal.gschema.xml
+++ b/src/org.gnome.Terminal.gschema.xml
@@ -276,22 +276,22 @@
       <description>Run this command in place of the shell, if use_custom_command is true.</description>
     </key>
     <key name="palette" type="as">
-      <default>["#2E2E34343636",
-                "#CCCC00000000",
-                "#4E4E9A9A0606",
-                "#C4C4A0A00000",
-                "#34346565A4A4",
-                "#757550507B7B",
-                "#060698209A9A",
-                "#D3D3D7D7CFCF",
-                "#555557575353",
-                "#EFEF29292929",
-                "#8A8AE2E23434",
-                "#FCFCE9E94F4F",
-                "#72729F9FCFCF",
-                "#ADAD7F7FA8A8",
-                "#3434E2E2E2E2",
-                "#EEEEEEEEECEC"]</default>
+      <default>["#2E3436",
+                "#CC0000",
+                "#4E9A06",
+                "#C4A000",
+                "#3465A4",
+                "#75507B",
+                "#06989A",
+                "#D3D7CF",
+                "#555753",
+                "#EF2929",
+                "#8AE234",
+                "#FCE94F",
+                "#729FCF",
+                "#AD7FA8",
+                "#34E2E2",
+                "#EEEEEC"]</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 2fa9a8e..d1043af 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -1,4 +1,3 @@
-
 /*
  * Copyright © 2002 Havoc Pennington
  * Copyright © 2002 Mathias Hasselmann
@@ -46,36 +45,38 @@ struct _TerminalColorScheme
   const GdkRGBA background;
 };
 
+#define COLOR(r, g, b) { .red = (r) / 255.0, .green = (g) / 255.0, .blue = (b) / 255.0, .alpha = 1.0 }
+
 static const TerminalColorScheme color_schemes[] = {
   { N_("Black on light yellow"),
-    { 0, 0, 0, 1 },
-    { 1, 1, 0.866667, 1 }
+    COLOR (0x00, 0x00, 0x00),
+    COLOR (0xff, 0xff, 0xdd)
   },
   { N_("Black on white"),
-    { 0, 0, 0, 1 },
-    { 1, 1, 1, 1 }
+    COLOR (0x00, 0x00, 0x00),
+    COLOR (0xff, 0xff, 0xff)
   },
   { N_("Gray on black"),
-    { 0.666667, 0.666667, 0.666667, 1 },
-    { 0, 0, 0, 1 }
+    COLOR (0xaa, 0xaa, 0xaa),
+    COLOR (0x00, 0x00, 0x00)
   },
   { N_("Green on black"),
-    { 0, 1, 0, 1 },
-    { 0, 0, 0, 1 }
+    COLOR (0x00, 0xff, 0x00),
+    COLOR (0x00, 0x00, 0x00)
   },
   { N_("White on black"),
-    { 1, 1, 1, 1 },
-    { 0, 0, 0, 1 }
+    COLOR (0xff, 0xff, 0xff),
+    COLOR (0x00, 0x00, 0x00)
   },
   /* Translators: "Solarized" is the name of a colour scheme, "light" can be translated */
   { N_("Solarized light"),
-    { 0.396078, 0.482352, 0.513725, 1 },
-    { 0.992156, 0.964705, 0.890196, 1 }
+    COLOR (0x65, 0x7B, 0x83),
+    COLOR (0xfd, 0xf6, 0xe3)
   },
   /* Translators: "Solarized" is the name of a colour scheme, "dark" can be translated */
   { N_("Solarized dark"),
-    { 0.513725, 0.580392, 0.588235, 1 },
-    { 0,        0.168627, 0.211764, 1 }
+    COLOR (0x83, 0x94, 0x96),
+    COLOR (0x00, 0x2b, 0x36)
   },
 };
 
@@ -91,8 +92,6 @@ enum
   TERMINAL_PALETTE_N_BUILTINS
 };
 
-#define COLOR(r, g, b) { .red = (r) / 255.0, .green = (g) / 255.0, .blue = (b) / 255.0, .alpha = 1.0 }
-
 static const GdkRGBA terminal_palettes[TERMINAL_PALETTE_N_BUILTINS][TERMINAL_PALETTE_SIZE] =
 {
   /* Tango palette */


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