From e3d1d5e61e320f221447d373683475956839969c Mon Sep 17 00:00:00 2001 From: Tri Nguyen Date: Mon, 20 Nov 2017 22:08:22 -0500 Subject: [PATCH 1/2] use base16-xresources --- .../schemes/Base16 Default Dark | 98 ++++++++++--------- 1 file changed, 54 insertions(+), 44 deletions(-) diff --git a/terminus-community-color-schemes/schemes/Base16 Default Dark b/terminus-community-color-schemes/schemes/Base16 Default Dark index 837ac274..413a1e83 100644 --- a/terminus-community-color-schemes/schemes/Base16 Default Dark +++ b/terminus-community-color-schemes/schemes/Base16 Default Dark @@ -1,44 +1,54 @@ -! -! Generated with : -! XRDB2Xreources.py -! -*.foreground: #d8d8d8 -*.background: #181818 -*.cursorColor: #d8d8d8 -! -! Black -*.color0: #181818 -*.color8: #585858 -! -! Red -*.color1: #ab4642 -*.color9: #ab4642 -! -! Green -*.color2: #a1b56c -*.color10: #a1b56c -! -! Yellow -*.color3: #f7ca88 -*.color11: #f7ca88 -! -! Blue -*.color4: #7cafc2 -*.color12: #7cafc2 -! -! Magenta -*.color5: #ba8baf -*.color13: #ba8baf -! -! Cyan -*.color6: #86c1b9 -*.color14: #86c1b9 -! -! White -*.color7: #d8d8d8 -*.color15: #f8f8f8 -! -! Bold, Italic, Underline -*.colorBD: #d8d8d8 -!*.colorIT: -!*.colorUL: +! Base16 Default Dark +! Scheme: Chris Kempson (http://chriskempson.com) + +#define base00 #181818 +#define base01 #282828 +#define base02 #383838 +#define base03 #585858 +#define base04 #b8b8b8 +#define base05 #d8d8d8 +#define base06 #e8e8e8 +#define base07 #f8f8f8 +#define base08 #ab4642 +#define base09 #dc9656 +#define base0A #f7ca88 +#define base0B #a1b56c +#define base0C #86c1b9 +#define base0D #7cafc2 +#define base0E #ba8baf +#define base0F #a16946 + +*.foreground: base05 +#ifdef background_opacity +*.background: [background_opacity]base00 +#else +*.background: base00 +#endif +*.cursorColor: base05 + +*.color0: base00 +*.color1: base08 +*.color2: base0B +*.color3: base0A +*.color4: base0D +*.color5: base0E +*.color6: base0C +*.color7: base05 + +*.color8: base03 +*.color9: base08 +*.color10: base0B +*.color11: base0A +*.color12: base0D +*.color13: base0E +*.color14: base0C +*.color15: base07 + +! Note: colors beyond 15 might not be loaded (e.g., xterm, urxvt), +! use 'shell' template to set these if necessary +*.color16: base09 +*.color17: base0F +*.color18: base01 +*.color19: base02 +*.color20: base04 +*.color21: base06 From 953558a8664389ccd1daefc9d96d9d6e4cacc423 Mon Sep 17 00:00:00 2001 From: Tri Nguyen Date: Thu, 14 Dec 2017 23:48:39 -0500 Subject: [PATCH 2/2] process #define variables --- terminus-community-color-schemes/src/colorSchemes.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/terminus-community-color-schemes/src/colorSchemes.ts b/terminus-community-color-schemes/src/colorSchemes.ts index b3f4f465..05fd83a3 100644 --- a/terminus-community-color-schemes/src/colorSchemes.ts +++ b/terminus-community-color-schemes/src/colorSchemes.ts @@ -10,13 +10,23 @@ export class ColorSchemes extends TerminalColorSchemeProvider { schemeContents.keys().forEach(schemeFile => { let lines = (schemeContents(schemeFile) as string).split('\n') + + // process #define variables + let variables: any = {} + lines + .filter(x => x.startsWith('#define')) + .map(x => x.split(' ').map(v => v.trim())) + .forEach(([ignore, variableName, variableValue]) => { + variables[variableName] = variableValue + }) + let values: any = {} lines .filter(x => x.startsWith('*.')) .map(x => x.substring(2)) .map(x => x.split(':').map(v => v.trim())) .forEach(([key, value]) => { - values[key] = value + values[key] = variables[value] ? variables[value] : value }) let colors: string[] = []