mirror of
https://github.com/joshdick/onedark.vim.git
synced 2025-11-13 13:33:49 -05:00
Tweak terminal color scheme selection colors to be more sensible.
Fixes #104.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const _ = require('lodash') // ships with termcolors; only used because of termcolors customization
|
||||
const doT = require('doT')
|
||||
const termcolors = require('termcolors')
|
||||
const { readFileSync, writeFileSync } = require('fs')
|
||||
@@ -115,9 +116,45 @@ try {
|
||||
const xresources = readFileSync(resolve(__dirname, '../term/One Dark.Xresources'), 'utf8')
|
||||
const terminalPalette = termcolors.xresources.import(xresources)
|
||||
|
||||
let itermTemplate, terminalAppTemplate
|
||||
|
||||
// Compile custom terminal color templates based on ones that ship with termcolors
|
||||
try {
|
||||
writeFileSync(resolve(__dirname, '../term/One\ Dark.itermcolors'), termcolors.iterm.export(terminalPalette))
|
||||
writeFileSync(resolve(__dirname, '../term/One\ Dark.terminal'), termcolors.terminalapp.export(terminalPalette))
|
||||
itermTemplate = termcolors.export(
|
||||
// From termcolors/lib/formats/iterm.js
|
||||
readFileSync(resolve(__dirname, 'templates/One\ Dark.itermcolors')),
|
||||
_.partialRight(_.mapValues, function (color) {
|
||||
return color.toAvgRgbArray()
|
||||
})
|
||||
)
|
||||
|
||||
// From termcolors/lib/formats/terminal-app.js
|
||||
const code = [
|
||||
new Buffer('62706c6973743030d40102030405061516582476657273696f6e58246f626a65637473592461726368697665725424746f7012000186a0a307080f55246e756c6cd3090a0b0c0d0e554e535247425c4e53436f6c6f7253706163655624636c6173734f1027', 'hex'),
|
||||
new Buffer('0010018002d2101112135a24636c6173736e616d655824636c6173736573574e53436f6c6f72a21214584e534f626a6563745f100f4e534b657965644172636869766572d1171854726f6f74800108111a232d32373b41484e5b628c8e9095a0a9b1b4bdcfd2d700000000000001010000000000000019000000000000000000000000000000d9', 'hex')
|
||||
]
|
||||
|
||||
terminalAppTemplate = termcolors.export(
|
||||
readFileSync(resolve(__dirname, 'templates/One\ Dark.terminal')),
|
||||
// From termcolors/lib/formats/terminal-app.js
|
||||
_.partialRight(_.mapValues, function (color) {
|
||||
var srgb = color.toAvgRgbArray()
|
||||
srgb = srgb.map(function (n) {
|
||||
return n.toFixed(10).toString()
|
||||
}).join(' ')
|
||||
var output = code[0].toString('binary') + srgb + code[1].toString('binary')
|
||||
output = (new Buffer(output, 'binary')).toString('base64')
|
||||
return output.match(/.{1,68}/g).join('\n\t')
|
||||
})
|
||||
)
|
||||
|
||||
} catch (e) {
|
||||
handleError('Error compiling terminal color template', e)
|
||||
}
|
||||
|
||||
try {
|
||||
writeFileSync(resolve(__dirname, '../term/One\ Dark.itermcolors'), itermTemplate(terminalPalette))
|
||||
writeFileSync(resolve(__dirname, '../term/One\ Dark.terminal'), terminalAppTemplate(terminalPalette))
|
||||
} catch (e) {
|
||||
handleError('Error writing terminal color file', e)
|
||||
}
|
||||
|
||||
259
build/templates/One Dark.itermcolors
Normal file
259
build/templates/One Dark.itermcolors
Normal file
@@ -0,0 +1,259 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Ansi 0 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[0][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[0][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[0][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 1 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[1][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[1][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[1][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 10 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[10][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[10][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[10][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 11 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[11][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[11][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[11][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 12 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[12][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[12][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[12][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 13 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[13][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[13][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[13][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 14 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[14][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[14][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[14][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 15 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[15][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[15][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[15][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 2 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[2][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[2][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[2][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 3 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[3][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[3][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[3][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 4 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[4][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[4][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[4][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 5 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[5][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[5][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[5][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 6 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[6][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[6][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[6][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 7 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[7][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[7][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[7][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 8 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[8][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[8][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[8][0]}}</real>
|
||||
</dict>
|
||||
<key>Ansi 9 Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c[9][2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c[9][1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c[9][0]}}</real>
|
||||
</dict>
|
||||
<key>Background Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c.background[2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c.background[1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c.background[0]}}</real>
|
||||
</dict>
|
||||
<key>Bold Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c.foreground[2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c.foreground[1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c.foreground[0]}}</real>
|
||||
</dict>
|
||||
<key>Cursor Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c.foreground[2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c.foreground[1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c.foreground[0]}}</real>
|
||||
</dict>
|
||||
<key>Cursor Text Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c.background[2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c.background[1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c.background[0]}}</real>
|
||||
</dict>
|
||||
<key>Foreground Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c.foreground[2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c.foreground[1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c.foreground[0]}}</real>
|
||||
</dict>
|
||||
<key>Selected Text Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c.background[2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c.background[1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c.background[0]}}</real>
|
||||
</dict>
|
||||
<key>Selection Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>{{=c.foreground[2]}}</real>
|
||||
<key>Green Component</key>
|
||||
<real>{{=c.foreground[1]}}</real>
|
||||
<key>Red Component</key>
|
||||
<real>{{=c.foreground[0]}}</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
94
build/templates/One Dark.terminal
Normal file
94
build/templates/One Dark.terminal
Normal file
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>ANSIBlackColor</key>
|
||||
<data>
|
||||
{{=c[0]}}
|
||||
</data>
|
||||
<key>ANSIBlueColor</key>
|
||||
<data>
|
||||
{{=c[4]}}
|
||||
</data>
|
||||
<key>ANSIBrightBlackColor</key>
|
||||
<data>
|
||||
{{=c[8]}}
|
||||
</data>
|
||||
<key>ANSIBrightBlueColor</key>
|
||||
<data>
|
||||
{{=c[12]}}
|
||||
</data>
|
||||
<key>ANSIBrightCyanColor</key>
|
||||
<data>
|
||||
{{=c[14]}}
|
||||
</data>
|
||||
<key>ANSIBrightGreenColor</key>
|
||||
<data>
|
||||
{{=c[10]}}
|
||||
</data>
|
||||
<key>ANSIBrightMagentaColor</key>
|
||||
<data>
|
||||
{{=c[13]}}
|
||||
</data>
|
||||
<key>ANSIBrightRedColor</key>
|
||||
<data>
|
||||
{{=c[9]}}
|
||||
</data>
|
||||
<key>ANSIBrightWhiteColor</key>
|
||||
<data>
|
||||
{{=c[15]}}
|
||||
</data>
|
||||
<key>ANSIBrightYellowColor</key>
|
||||
<data>
|
||||
{{=c[11]}}
|
||||
</data>
|
||||
<key>ANSICyanColor</key>
|
||||
<data>
|
||||
{{=c[6]}}
|
||||
</data>
|
||||
<key>ANSIGreenColor</key>
|
||||
<data>
|
||||
{{=c[2]}}
|
||||
</data>
|
||||
<key>ANSIMagentaColor</key>
|
||||
<data>
|
||||
{{=c[5]}}
|
||||
</data>
|
||||
<key>ANSIRedColor</key>
|
||||
<data>
|
||||
{{=c[1]}}
|
||||
</data>
|
||||
<key>ANSIWhiteColor</key>
|
||||
<data>
|
||||
{{=c[7]}}
|
||||
</data>
|
||||
<key>ANSIYellowColor</key>
|
||||
<data>
|
||||
{{=c[3]}}
|
||||
</data>
|
||||
<key>BackgroundColor</key>
|
||||
<data>
|
||||
{{=c.background}}
|
||||
</data>
|
||||
<key>CursorColor</key>
|
||||
<data>
|
||||
{{=c.foreground}}
|
||||
</data>
|
||||
<key>SelectionColor</key>
|
||||
<data>
|
||||
{{=c[15]}}
|
||||
</data>
|
||||
<key>TextBoldColor</key>
|
||||
<data>
|
||||
{{=c.foreground}}
|
||||
</data>
|
||||
<key>TextColor</key>
|
||||
<data>
|
||||
{{=c.foreground}}
|
||||
</data>
|
||||
<key>name</key>
|
||||
<string>One Dark</string>
|
||||
<key>type</key>
|
||||
<string>Window Settings</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -234,17 +234,6 @@
|
||||
<real>0.6705882352941176</real>
|
||||
</dict>
|
||||
<key>Selected Text Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>0.7490196078431373</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.6980392156862745</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.6705882352941176</real>
|
||||
</dict>
|
||||
<key>Selection Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
@@ -255,5 +244,16 @@
|
||||
<key>Red Component</key>
|
||||
<real>0.1568627450980392</real>
|
||||
</dict>
|
||||
<key>Selection Color</key>
|
||||
<dict>
|
||||
<key>Color Space</key>
|
||||
<string>sRGB</string>
|
||||
<key>Blue Component</key>
|
||||
<real>0.7490196078431373</real>
|
||||
<key>Green Component</key>
|
||||
<real>0.6980392156862745</real>
|
||||
<key>Red Component</key>
|
||||
<real>0.6705882352941176</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
<data>
|
||||
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
|
||||
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw
|
||||
LjMzNzI1NDkwMjAgMC43MTM3MjU0OTAyIDAuNzYwNzg0MzEzNwAQAYAC0hAREhNaJGNs
|
||||
LjM2MDc4NDMxMzcgMC4zODgyMzUyOTQxIDAuNDM5MjE1Njg2MwAQAYAC0hAREhNaJGNs
|
||||
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp
|
||||
dmVy0RcYVHJvb3SAAQgRGiMtMjc7QUhOW2KMjpCVoKmxtL3P0tcAAAAAAAABAQAAAAAA
|
||||
AAAZAAAAAAAAAAAAAAAAAAAA2Q==
|
||||
@@ -192,7 +192,7 @@
|
||||
AAAZAAAAAAAAAAAAAAAAAAAA2Q==
|
||||
</data>
|
||||
<key>name</key>
|
||||
<string>terminal.sexy</string>
|
||||
<string>One Dark</string>
|
||||
<key>type</key>
|
||||
<string>Window Settings</string>
|
||||
</dict>
|
||||
|
||||
Reference in New Issue
Block a user