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.
This commit is contained in:
Josh Dick
2020-01-20 17:34:29 -05:00
committed by GitHub
parent 6a98de099d
commit 181a7866bc
9 changed files with 121 additions and 31 deletions

View File

@@ -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)
}