]> git.mdlowis.com Git - projs/tide.git/commitdiff
Tweaked palette behavior to use base16 approach by default
authorMichael D. Lowis <mike.lowis@gentex.com>
Thu, 29 Jun 2017 14:01:14 +0000 (10:01 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Thu, 29 Jun 2017 14:01:14 +0000 (10:01 -0400)
TODO.md
lib/config.c
lib/x11.c
themes/acme
themes/monokai [new file with mode: 0644]

diff --git a/TODO.md b/TODO.md
index 6d0ee5ffbfc917f0fa917f582b61e08076b53e43..05882683f035b03eabfbc699e3b588d35cae6699 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -87,9 +87,7 @@ Region  GROUP start=REGEX skip=REGEX end=REGEX
 
 https://www.slant.co/topics/358/~best-color-themes-for-text-editors
 
-* Acme
 * Wily
-* Solarized
 * Gruvbox
 * badwolf
 * jelly beans
@@ -123,6 +121,3 @@ https://www.slant.co/topics/358/~best-color-themes-for-text-editors
 * lean theme
 * cheerfully dark
 * gotham
-
-
-
index 619e3df933438dd0cab51b32a5d7acfc0301880b..412522eb8faf01a3b4eba8b5a1b07df8e9928544 100644 (file)
@@ -53,44 +53,45 @@ struct {
     [Color05] = { "tide.palette.05", INTEGER, { .num = 0xff93a1a1 } },
     [Color06] = { "tide.palette.06", INTEGER, { .num = 0xffeee8d5 } },
     [Color07] = { "tide.palette.07", INTEGER, { .num = 0xfffdf6e3 } },
-    [Color08] = { "tide.palette.08", INTEGER, { .num = 0xffb58900 } },
+    [Color08] = { "tide.palette.08", INTEGER, { .num = 0xffdc322f } },
     [Color09] = { "tide.palette.09", INTEGER, { .num = 0xffcb4b16 } },
-    [Color10] = { "tide.palette.10", INTEGER, { .num = 0xffdc322f } },
-    [Color11] = { "tide.palette.11", INTEGER, { .num = 0xffd33682 } },
-    [Color12] = { "tide.palette.12", INTEGER, { .num = 0xff6c71c4 } },
+    [Color10] = { "tide.palette.10", INTEGER, { .num = 0xffb58900 } },
+    [Color11] = { "tide.palette.11", INTEGER, { .num = 0xff859900 } },
+    [Color12] = { "tide.palette.12", INTEGER, { .num = 0xff2aa198 } },
     [Color13] = { "tide.palette.13", INTEGER, { .num = 0xff268bd2 } },
-    [Color14] = { "tide.palette.14", INTEGER, { .num = 0xff2aa198 } },
-    [Color15] = { "tide.palette.15", INTEGER, { .num = 0xff859900 } },
+    [Color14] = { "tide.palette.14", INTEGER, { .num = 0xff6c71c4 } },
+    [Color15] = { "tide.palette.15", INTEGER, { .num = 0xffd33682 } },
 
     /* UI Colors */
     [ClrScrollNor] = { "tide.colors.scroll.normal",   INTEGER, { .num = 0x0300 } },
     [ClrGutterNor] = { "tide.colors.gutter.normal",   INTEGER, { .num = 0x0103 } },
     [ClrGutterSel] = { "tide.colors.gutter.selected", INTEGER, { .num = 0x0D07 } },
-    [ClrStatusNor] = { "tide.colors.status.normal",   INTEGER, { .num = 0x0004 } },
-    [ClrTagsNor]   = { "tide.colors.tags.normal",     INTEGER, { .num = 0x0104 } },
-    [ClrTagsSel]   = { "tide.colors.tags.selected",   INTEGER, { .num = 0x0401 } },
+    [ClrStatusNor] = { "tide.colors.status.normal",   INTEGER, { .num = 0x0005 } },
+    [ClrTagsNor]   = { "tide.colors.tags.normal",     INTEGER, { .num = 0x0105 } },
+    [ClrTagsSel]   = { "tide.colors.tags.selected",   INTEGER, { .num = 0x0501 } },
     [ClrTagsCsr]   = { "tide.colors.tags.cursor",     INTEGER, { .num = 0x07   } },
-    [ClrEditNor]   = { "tide.colors.edit.normal",     INTEGER, { .num = 0x0004 } },
-    [ClrEditSel]   = { "tide.colors.edit.selected",   INTEGER, { .num = 0x0400 } },
+    [ClrEditNor]   = { "tide.colors.edit.normal",     INTEGER, { .num = 0x0005 } },
+    [ClrEditSel]   = { "tide.colors.edit.selected",   INTEGER, { .num = 0x0500 } },
     [ClrEditCsr]   = { "tide.colors.edit.cursor",     INTEGER, { .num = 0x07   } },
     [ClrEditRul]   = { "tide.colors.edit.ruler",      INTEGER, { .num = 0x01   } },
     [ClrBorders]   = { "tide.colors.borders",         INTEGER, { .num = 0x0303 } },
 
     /* Syntax Colors */
     [SynNormal]    = { "tide.colors.syntax.normal",       INTEGER, { .num = 0x0004 } },
-    [SynComment]   = { "tide.colors.syntax.comment",      INTEGER, { .num = 0x0002 } },
-    [SynConstant]  = { "tide.colors.syntax.constant",     INTEGER, { .num = 0x000E } },
-    [SynString]    = { "tide.colors.syntax.string",       INTEGER, { .num = 0x000E } },
-    [SynChar]      = { "tide.colors.syntax.character",    INTEGER, { .num = 0x000E } },
-    [SynNumber]    = { "tide.colors.syntax.number",       INTEGER, { .num = 0x000E } },
-    [SynBoolean]   = { "tide.colors.syntax.boolean",      INTEGER, { .num = 0x000E } },
-    [SynFloat]     = { "tide.colors.syntax.float",        INTEGER, { .num = 0x000E } },
+    [SynComment]   = { "tide.colors.syntax.comment",      INTEGER, { .num = 0x0003 } },
+    [SynConstant]  = { "tide.colors.syntax.constant",     INTEGER, { .num = 0x000C } },
+    [SynString]    = { "tide.colors.syntax.string",       INTEGER, { .num = 0x000C } },
+    [SynChar]      = { "tide.colors.syntax.character",    INTEGER, { .num = 0x000C } },
+    [SynNumber]    = { "tide.colors.syntax.number",       INTEGER, { .num = 0x000C } },
+    [SynBoolean]   = { "tide.colors.syntax.boolean",      INTEGER, { .num = 0x000C } },
+    [SynFloat]     = { "tide.colors.syntax.float",        INTEGER, { .num = 0x000C } },
+
     [SynVariable]  = { "tide.colors.syntax.variable",     INTEGER, { .num = 0x000D } },
     [SynFunction]  = { "tide.colors.syntax.function",     INTEGER, { .num = 0x000D } },
-    [SynKeyword]   = { "tide.colors.syntax.keyword",      INTEGER, { .num = 0x000F } },
-    [SynOperator]  = { "tide.colors.syntax.operator",     INTEGER, { .num = 0x000F } },
+    [SynKeyword]   = { "tide.colors.syntax.keyword",      INTEGER, { .num = 0x000B } },
+    [SynOperator]  = { "tide.colors.syntax.operator",     INTEGER, { .num = 0x000A } },
     [SynPreProc]   = { "tide.colors.syntax.preprocessor", INTEGER, { .num = 0x0009 } },
-    [SynType]      = { "tide.colors.syntax.type",         INTEGER, { .num = 0x0008 } },
+    [SynType]      = { "tide.colors.syntax.type",         INTEGER, { .num = 0x000A } },
     [SynStatement] = { "tide.colors.syntax.statement",    INTEGER, { .num = 0x000F } },
     [SynSpecial]   = { "tide.colors.syntax.special",      INTEGER, { .num = 0x000A } },
 };
index 9393aa9768ecb1a9525a3582ff72709ea5662c8d..17530cde0469960e98277a68f79507fea545f4e5 100644 (file)
--- a/lib/x11.c
+++ b/lib/x11.c
@@ -65,11 +65,12 @@ static struct XSel {
 };
 
 static void xftcolor(XftColor* xc, int id) {
+    #define COLOR(c) ((c) | ((c) >> 8))
     uint32_t c = config_get_int(id + Color00);
-    xc->color.alpha = 0xFF | ((c & 0xFF000000) >> 16);
-    xc->color.red   = 0xFF | ((c & 0x00FF0000) >> 8);
-    xc->color.green = 0xFF | ((c & 0x0000FF00));
-    xc->color.blue  = 0xFF | ((c & 0x000000FF) << 8);
+    xc->color.alpha = COLOR((c & 0xFF000000) >> 16);
+    xc->color.red   = COLOR((c & 0x00FF0000) >> 8);
+    xc->color.green = COLOR((c & 0x0000FF00));
+    xc->color.blue  = COLOR((c & 0x000000FF) << 8);
     XftColorAllocValue(X.display, X.visual, X.colormap, &(xc->color), xc);
 }
 
index 966fb4f28ee83dde0b76eda10b78318e79ba5e33..830af2d6e28b49c8509688098908abfd43363be3 100644 (file)
@@ -9,25 +9,31 @@ tide.ui.line_numbers:   false
 tide.ui.ruler_column:   0
 
 ! Color Palette
-tide.palette.00: 0xff000000 ! 00 (4) - text color
-tide.palette.01: 0xff99994c ! 01 (3) - scroll background
-tide.palette.02: 0xffeaffff ! 02 (0) - tags background
-tide.palette.03: 0xff9eeeee ! 03 (5) - tags selection background
-tide.palette.04: 0xffffffea ! 04 (1) - edit background
-tide.palette.05: 0xffeeee9e ! 05 (2) - edit selected background
-tide.palette.06: 0xff8888cc ! 06 (6) - horizontal border
-tide.palette.07: 0xff000099 ! 07 (7) - Unused
+tide.palette.00: 0xffffffea ! 00 (0) - edit background
+tide.palette.01: 0xffeaffff ! 01 (1) - tags background
+tide.palette.02: 0xff9eeeee ! 02 (2) - tags selection background
+tide.palette.03: 0xff99994c ! 03 (3) - scroll background
+tide.palette.04: 0xffeeee9e ! 02 (4) - edit selection background
+tide.palette.05: 0xff000000 ! 05 (5) - edit foreground
+tide.palette.06: 0xff000000 ! 06 (6) - tags foreground
+tide.palette.07: 0xff8888cc ! 07 (7) - horizontal border
+tide.palette.08: 0xff000000
+tide.palette.09: 0xff000000
+tide.palette.10: 0xff000000
+tide.palette.11: 0xff000000
+tide.palette.12: 0xff000000
+tide.palette.13: 0xff000000
+tide.palette.14: 0xff000000
+tide.palette.15: 0xff000000
 
-! Colors for UI Elements and Text
-tide.colors.scroll.normal:   0x0104
-tide.colors.gutter.normal:   0x0200
-tide.colors.gutter.selected: 0x0300
-tide.colors.status.normal:   0x0400
-tide.colors.tags.normal:     0x0200
-tide.colors.tags.selected:   0x0300
-tide.colors.tags.cursor:     0x00
-tide.colors.edit.normal:     0x0400
-tide.colors.edit.selected:   0x0500
-tide.colors.edit.cursor:     0x00
-tide.colors.edit.ruler:      0x06
-tide.colors.borders:         0x0601
+! override default color pairs and cursors
+tide.colors.edit.selected:   0x0405
+tide.colors.tags.selected:   0x0206
+tide.colors.edit.cursor:     0x05
+tide.colors.tags.cursor:     0x06
+tide.colors.borders:         0x0703
+
+!! Colors for UI Elements and Text
+!tide.colors.gutter.normal:   0x0200
+!tide.colors.gutter.selected: 0x0300
+!tide.colors.edit.ruler:      0x06
diff --git a/themes/monokai b/themes/monokai
new file mode 100644 (file)
index 0000000..2b5797a
--- /dev/null
@@ -0,0 +1,21 @@
+!-------------------------------------------------------------------------------
+! Monokai
+!-------------------------------------------------------------------------------
+
+! 16-color Palette Definition
+tide.palette.00: 0xff272822 ! base00 - Default Background
+tide.palette.01: 0xff383830 ! base01 - Lighter Background (Used for status bars)
+tide.palette.02: 0xff49483e ! base02 - Selection Background
+tide.palette.03: 0xff75715e ! base03 - Comments, Invisibles, Line Highlighting
+tide.palette.04: 0xffa59f85 ! base04 - Dark Foreground (Used for status bars)
+tide.palette.05: 0xfff8f8f2 ! base05 - Default Foreground, Caret, Delimiters, Operators
+tide.palette.06: 0xfff5f4f1 ! base06 - Light Foreground (Not often used)
+tide.palette.07: 0xfff9f8f5 ! base07 - Light Background (Not often used)
+tide.palette.08: 0xfff92672 ! base08 - Variables, Diff Deleted
+tide.palette.09: 0xfffd971f ! base09 - Integers, Boolean, Constants
+tide.palette.10: 0xfff4bf75 ! base0A - Classes, Markup Bold, Search Text Background
+tide.palette.11: 0xffa6e22e ! base0B - Strings, Inherited Class, Markup Code, Diff Inserted
+tide.palette.12: 0xffa1efe4 ! base0C - Support, Regular Expressions, Escape Characters, Markup Quotes
+tide.palette.13: 0xff66d9ef ! base0D - Functions, Methods, Attribute IDs, Headings
+tide.palette.14: 0xffae81ff ! base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed
+tide.palette.15: 0xffcc6633 ! base0F - Deprecated, Opening/Closing Embedded Language Tags e.g.