From 181a7866bc1f7557a325a5e3b56ad1ce57582612 Mon Sep 17 00:00:00 2001 From: Josh Dick Date: Mon, 20 Jan 2020 17:34:29 -0500 Subject: [PATCH] Terminal color tweaks. (#201) * Add KiTTY configuration (manually; could potentially use https://github.com/stayradiated/termcolors/pull/17/ in the future) * Tweak foreground/background/white/black colors to be visually distinct from one another Closes #200. --- build/build.js | 18 +++++++++---- build/templates/One Dark.Xresources | 6 ++--- build/templates/One Dark.alacritty | 4 +-- build/templates/One Dark.kitty | 41 +++++++++++++++++++++++++++++ term/One Dark.Xresources | 6 ++--- term/One Dark.alacritty | 10 +++---- term/One Dark.itermcolors | 18 ++++++------- term/One Dark.kitty | 41 +++++++++++++++++++++++++++++ term/One Dark.terminal | 8 +++--- 9 files changed, 121 insertions(+), 31 deletions(-) create mode 100644 build/templates/One Dark.kitty create mode 100644 term/One Dark.kitty diff --git a/build/build.js b/build/build.js index 644dc70..7fa2829 100755 --- a/build/build.js +++ b/build/build.js @@ -103,10 +103,17 @@ try { const xresources = readFileSync(resolve(__dirname, '../term/One Dark.Xresources'), 'utf8') const terminalPalette = termcolors.xresources.import(xresources) - let itermTemplate, terminalAppTemplate, alacrittyTemplate + let alacrittyTemplate, itermTemplate, kittyTemplate, terminalAppTemplate // Compile custom terminal color templates based on ones that ship with termcolors try { + alacrittyTemplate = termcolors.export( + readFileSync(resolve(__dirname, 'templates/One Dark.alacritty')), + _.partialRight(_.mapValues, function (color) { + return color.toHex().slice(1) + }) + ) + itermTemplate = termcolors.export( // From termcolors/lib/formats/iterm.js readFileSync(resolve(__dirname, 'templates/One Dark.itermcolors')), @@ -115,8 +122,8 @@ try { }) ) - alacrittyTemplate = termcolors.export( - readFileSync(resolve(__dirname, 'templates/One Dark.alacritty')), + kittyTemplate = termcolors.export( + readFileSync(resolve(__dirname, 'templates/One Dark.kitty')), _.partialRight(_.mapValues, function (color) { return color.toHex().slice(1) }) @@ -147,9 +154,10 @@ try { } try { - writeFileSync(resolve(__dirname, '../term/One Dark.itermcolors'), itermTemplate(terminalPalette)) - writeFileSync(resolve(__dirname, '../term/One Dark.terminal'), terminalAppTemplate(terminalPalette)) writeFileSync(resolve(__dirname, '../term/One Dark.alacritty'), alacrittyTemplate(terminalPalette)) + writeFileSync(resolve(__dirname, '../term/One Dark.itermcolors'), itermTemplate(terminalPalette)) + writeFileSync(resolve(__dirname, '../term/One Dark.kitty'), kittyTemplate(terminalPalette)) + writeFileSync(resolve(__dirname, '../term/One Dark.terminal'), terminalAppTemplate(terminalPalette)) } catch (e) { handleError('Error writing terminal color file', e) } diff --git a/build/templates/One Dark.Xresources b/build/templates/One Dark.Xresources index 01875aa..4051d88 100644 --- a/build/templates/One Dark.Xresources +++ b/build/templates/One Dark.Xresources @@ -4,8 +4,8 @@ *.cursorColor: <%=white.gui%> ! black -*.color0: <%=black.gui%> -*.color8: <%=visual_grey.gui%> +*.color0: <%=comment_grey.gui%> +*.color8: <%=gutter_fg_grey.gui%> ! red *.color1: <%=red.gui%> @@ -33,5 +33,5 @@ ! white *.color7: <%=white.gui%> -*.color15: <%=comment_grey.gui%> +*.color15: <%=visual_grey.gui%> diff --git a/build/templates/One Dark.alacritty b/build/templates/One Dark.alacritty index 8f96286..a5d4f93 100644 --- a/build/templates/One Dark.alacritty +++ b/build/templates/One Dark.alacritty @@ -2,8 +2,8 @@ colors: # Default colors primary: - background: '0x{{=c[0]}}' - foreground: '0x{{=c[7]}}' + foreground: '0x{{=c.foreground}}' + background: '0x{{=c.background}}' # Cursor colors cursor: diff --git a/build/templates/One Dark.kitty b/build/templates/One Dark.kitty new file mode 100644 index 0000000..ceb8ef1 --- /dev/null +++ b/build/templates/One Dark.kitty @@ -0,0 +1,41 @@ +# Cursor +cursor #{{=c[7]}} +cursor_text_color #{{=c[0]}} + +# Special +foreground #{{=c.foreground}} +background #{{=c.background}} +selection_foreground #{{=c[0]}} +selection_background #{{=c[7]}} + +# Black +color0 #{{=c[0]}} +color8 #{{=c[8]}} + +# Red +color1 #{{=c[1]}} +color9 #{{=c[9]}} + +# Green +color2 #{{=c[2]}} +color10 #{{=c[10]}} + +# Yellow +color3 #{{=c[3]}} +color11 #{{=c[11]}} + +# Blue +color4 #{{=c[4]}} +color12 #{{=c[12]}} + +# Magenta +color5 #{{=c[5]}} +color13 #{{=c[13]}} + +# Cyan +color6 #{{=c[6]}} +color14 #{{=c[14]}} + +# White +color7 #{{=c[7]}} +color15 #{{=c[15]}} diff --git a/term/One Dark.Xresources b/term/One Dark.Xresources index cb88be7..3107e18 100644 --- a/term/One Dark.Xresources +++ b/term/One Dark.Xresources @@ -4,8 +4,8 @@ *.cursorColor: #ABB2BF ! black -*.color0: #282C34 -*.color8: #3E4452 +*.color0: #5C6370 +*.color8: #4B5263 ! red *.color1: #E06C75 @@ -33,5 +33,5 @@ ! white *.color7: #ABB2BF -*.color15: #5C6370 +*.color15: #3E4452 diff --git a/term/One Dark.alacritty b/term/One Dark.alacritty index b03f629..b864fd6 100644 --- a/term/One Dark.alacritty +++ b/term/One Dark.alacritty @@ -2,17 +2,17 @@ colors: # Default colors primary: - background: '0x282c34' foreground: '0xabb2bf' + background: '0x282c34' # Cursor colors cursor: - text: '0x282c34' + text: '0x5c6370' cursor: '0xabb2bf' # Normal colors normal: - black: '0x282c34' + black: '0x5c6370' red: '0xe06c75' green: '0x98c379' yellow: '0xe5c07b' @@ -23,12 +23,12 @@ colors: # Bright colors bright: - black: '0x3e4452' + black: '0x4b5263' red: '0xbe5046' green: '0x98c379' yellow: '0xd19a66' blue: '0x61afef' magenta: '0xc678dd' cyan: '0x56b6c2' - white: '0x5c6370' + white: '0x3e4452' diff --git a/term/One Dark.itermcolors b/term/One Dark.itermcolors index 471e0c5..dff657b 100644 --- a/term/One Dark.itermcolors +++ b/term/One Dark.itermcolors @@ -7,11 +7,11 @@ Color Space sRGB Blue Component - 0.20392156862745098 + 0.4392156862745098 Green Component - 0.17254901960784313 + 0.38823529411764707 Red Component - 0.1568627450980392 + 0.3607843137254902 Ansi 1 Color @@ -84,11 +84,11 @@ Color Space sRGB Blue Component - 0.4392156862745098 + 0.3215686274509804 Green Component - 0.38823529411764707 + 0.26666666666666666 Red Component - 0.3607843137254902 + 0.24313725490196078 Ansi 2 Color @@ -161,11 +161,11 @@ Color Space sRGB Blue Component - 0.3215686274509804 + 0.38823529411764707 Green Component - 0.26666666666666666 + 0.3215686274509804 Red Component - 0.24313725490196078 + 0.29411764705882354 Ansi 9 Color diff --git a/term/One Dark.kitty b/term/One Dark.kitty new file mode 100644 index 0000000..d102db1 --- /dev/null +++ b/term/One Dark.kitty @@ -0,0 +1,41 @@ +# Cursor +cursor #abb2bf +cursor_text_color #5c6370 + +# Special +foreground #abb2bf +background #282c34 +selection_foreground #5c6370 +selection_background #abb2bf + +# Black +color0 #5c6370 +color8 #4b5263 + +# Red +color1 #e06c75 +color9 #be5046 + +# Green +color2 #98c379 +color10 #98c379 + +# Yellow +color3 #e5c07b +color11 #d19a66 + +# Blue +color4 #61afef +color12 #61afef + +# Magenta +color5 #c678dd +color13 #c678dd + +# Cyan +color6 #56b6c2 +color14 #56b6c2 + +# White +color7 #abb2bf +color15 #3e4452 diff --git a/term/One Dark.terminal b/term/One Dark.terminal index d10c58b..a0417f2 100644 --- a/term/One Dark.terminal +++ b/term/One Dark.terminal @@ -6,7 +6,7 @@ YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw - LjE1Njg2Mjc0NTEgMC4xNzI1NDkwMTk2IDAuMjAzOTIxNTY4NgAQAYAC0hAREhNaJGNs + LjM2MDc4NDMxMzcgMC4zODgyMzUyOTQxIDAuNDM5MjE1Njg2MwAQAYAC0hAREhNaJGNs YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp dmVy0RcYVHJvb3SAAQgRG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