Merge pull request #241 from tnguyen14/base16-xresources

use base16-xresources
This commit is contained in:
Eugene Pankov 2017-12-15 19:07:55 +01:00 committed by GitHub
commit 30666c2838
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 65 additions and 45 deletions

View File

@ -1,44 +1,54 @@
! ! Base16 Default Dark
! Generated with : ! Scheme: Chris Kempson (http://chriskempson.com)
! XRDB2Xreources.py
! #define base00 #181818
*.foreground: #d8d8d8 #define base01 #282828
*.background: #181818 #define base02 #383838
*.cursorColor: #d8d8d8 #define base03 #585858
! #define base04 #b8b8b8
! Black #define base05 #d8d8d8
*.color0: #181818 #define base06 #e8e8e8
*.color8: #585858 #define base07 #f8f8f8
! #define base08 #ab4642
! Red #define base09 #dc9656
*.color1: #ab4642 #define base0A #f7ca88
*.color9: #ab4642 #define base0B #a1b56c
! #define base0C #86c1b9
! Green #define base0D #7cafc2
*.color2: #a1b56c #define base0E #ba8baf
*.color10: #a1b56c #define base0F #a16946
!
! Yellow *.foreground: base05
*.color3: #f7ca88 #ifdef background_opacity
*.color11: #f7ca88 *.background: [background_opacity]base00
! #else
! Blue *.background: base00
*.color4: #7cafc2 #endif
*.color12: #7cafc2 *.cursorColor: base05
!
! Magenta *.color0: base00
*.color5: #ba8baf *.color1: base08
*.color13: #ba8baf *.color2: base0B
! *.color3: base0A
! Cyan *.color4: base0D
*.color6: #86c1b9 *.color5: base0E
*.color14: #86c1b9 *.color6: base0C
! *.color7: base05
! White
*.color7: #d8d8d8 *.color8: base03
*.color15: #f8f8f8 *.color9: base08
! *.color10: base0B
! Bold, Italic, Underline *.color11: base0A
*.colorBD: #d8d8d8 *.color12: base0D
!*.colorIT: *.color13: base0E
!*.colorUL: *.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

View File

@ -10,13 +10,23 @@ export class ColorSchemes extends TerminalColorSchemeProvider {
schemeContents.keys().forEach(schemeFile => { schemeContents.keys().forEach(schemeFile => {
let lines = (schemeContents(schemeFile) as string).split('\n') 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 = {} let values: any = {}
lines lines
.filter(x => x.startsWith('*.')) .filter(x => x.startsWith('*.'))
.map(x => x.substring(2)) .map(x => x.substring(2))
.map(x => x.split(':').map(v => v.trim())) .map(x => x.split(':').map(v => v.trim()))
.forEach(([key, value]) => { .forEach(([key, value]) => {
values[key] = value values[key] = variables[value] ? variables[value] : value
}) })
let colors: string[] = [] let colors: string[] = []