colorschemes: use ini instead of json

This commit is contained in:
Boris Faure 2020-10-07 23:48:04 +02:00
parent e90202923d
commit c023c7e3ff
Signed by: borisfaure
GPG Key ID: 35C0410516166BE8
19 changed files with 370 additions and 358 deletions

View File

@ -0,0 +1,42 @@
[Main]
version = 1
[Metadata]
version = 1
name = Mild
author = Terminology's developers
website = https://www.enlightenment.org/about-terminology
license = BSD-2-Clause
[Colors]
def = #aaaaaa
bg = #303030
fg = #aaaaaa
main = #dcdcdc
hl = #ffffff
end_sel = #ff0000
tab_missed_1 = #ff9933
tab_missed_2 = #ff3300
tab_missed_3 = #ff0000
tab_missed_over_1 = #ffff33
tab_missed_over_2 = #ff9933
tab_missed_over_3 = #ff0000
tab_title_2 = #000000
[Ansi]
ansi00 = #000000
ansi01 = #ff6565
ansi02 = #93d44f
ansi03 = #eab93d
ansi04 = #204a87
ansi05 = #ce5c00
ansi06 = #89b6e2
ansi07 = #cccccc
ansi08 = #555753
ansi09 = #ff8d8d
ansi10 = #c8e7a8
ansi11 = #ffc123
ansi12 = #3465a4
ansi13 = #f57900
ansi14 = #46a400
ansi15 = #ffffff

View File

@ -1,41 +0,0 @@
{
"version": 1,
"md": {
"version": 1,
"name": "Mild",
"author": "Terminology's developers",
"website": "https://www.enlightenment.org/about-terminology",
"license": "BSD-2-Clause"
},
"def": "#aaaaaa",
"bg": "#303030",
"fg": "#aaaaaa",
"main": "#dcdcdc",
"hl": "#ffffff",
"end_sel": "#ff0000",
"tab_missed_1": "#ff9933",
"tab_missed_2": "#ff3300",
"tab_missed_3": "#ff0000",
"tab_missed_over_1": "#ffff33",
"tab_missed_over_2": "#ff9933",
"tab_missed_over_3": "#ff0000",
"tab_title_2": "#000000",
"ansi": [
"#000000",
"#ff6565",
"#93d44f",
"#eab93d",
"#204a87",
"#ce5c00",
"#89b6e2",
"#cccccc",
"#555753",
"#ff8d8d",
"#c8e7a8",
"#ffc123",
"#3465a4",
"#f57900",
"#46a400",
"#ffffff"
]
}

View File

@ -0,0 +1,42 @@
[Main]
version = 1
[Metadata]
version = 1
name = Mustang
author = Henrique C. Alves
website = https://www.deviantart.com/hcalves/art/Mustang-Vim-Colorscheme-98974484
license = MIT
[Colors]
def = #ffffff
bg = #1a1a1a
fg = #aaaaaa
main = #3399ff
hl = #ffffff
end_sel = #ff0000
tab_missed_1 = #ff9933
tab_missed_2 = #ff3300
tab_missed_3 = #ff0000
tab_missed_over_1 = #ffff33
tab_missed_over_2 = #ff9933
tab_missed_over_3 = #ff0000
tab_title_2 = #000000
[Ansi]
ansi00 = #000000
ansi01 = #ff6565
ansi02 = #93d44f
ansi03 = #eab93d
ansi04 = #204a87
ansi05 = #ce5c00
ansi06 = #89b6e2
ansi07 = #cccccc
ansi08 = #555753
ansi09 = #ff8d8d
ansi10 = #c8e7a8
ansi11 = #ffc123
ansi12 = #3465a4
ansi13 = #f57900
ansi14 = #46a400
ansi15 = #ffffff

View File

@ -1,41 +0,0 @@
{
"version": 1,
"md": {
"version": 1,
"name": "Mustang",
"author": "Henrique C. Alves",
"website": "https://www.deviantart.com/hcalves/art/Mustang-Vim-Colorscheme-98974484",
"license": "MIT"
},
"def": "#ffffff",
"bg": "#1a1a1a",
"fg": "#aaaaaa",
"main": "#3399ff",
"hl": "#ffffff",
"end_sel": "#ff0000",
"tab_missed_1": "#ff9933",
"tab_missed_2": "#ff3300",
"tab_missed_3": "#ff0000",
"tab_missed_over_1": "#ffff33",
"tab_missed_over_2": "#ff9933",
"tab_missed_over_3": "#ff0000",
"tab_title_2": "#000000",
"ansi": [
"#000000",
"#ff6565",
"#93d44f",
"#eab93d",
"#204a87",
"#ce5c00",
"#89b6e2",
"#cccccc",
"#555753",
"#ff8d8d",
"#c8e7a8",
"#ffc123",
"#3465a4",
"#f57900",
"#46a400",
"#ffffff"
]
}

View File

@ -0,0 +1,42 @@
[Main]
version = 1
[Metadata]
version = 1
name = Nord
author = Arctic Ice Studio
website = https://git.io/nord
license = MIT
[Colors]
def = #d8dee9
bg = #2e3440
fg = #d8dee9
main = #88c0d0
hl = #ffffff
end_sel = #ff3300
tab_missed_1 = #ff9933
tab_missed_2 = #ff3300
tab_missed_3 = #ff0000
tab_missed_over_1 = #ffff40
tab_missed_over_2 = #ff9933
tab_missed_over_3 = #ff0000
tab_title_2 = #000000
[Ansi]
ansi00 = #3b4252
ansi01 = #bf616a
ansi02 = #a3be8c
ansi03 = #ebcb8b
ansi04 = #81a1c1
ansi05 = #b48ead
ansi06 = #88c0d0
ansi07 = #e5e9f8
ansi08 = #4c566a
ansi09 = #bf616a
ansi10 = #a3be8c
ansi11 = #ebcb8b
ansi12 = #81a1c1
ansi13 = #b48ead
ansi14 = #8fbcbb
ansi15 = #eceff4

View File

@ -1,41 +0,0 @@
{
"version": 1,
"md": {
"version": 1,
"name": "Nord",
"author": "Arctic Ice Studio",
"website": "https://git.io/nord",
"license": "MIT"
},
"def": "#d8dee9",
"bg": "#2e3440",
"fg": "#d8dee9",
"main": "#88c0d0",
"hl": "#ffffff",
"end_sel": "#ff3300",
"tab_missed_1": "#ff9933",
"tab_missed_2": "#ff3300",
"tab_missed_3": "#ff0000",
"tab_missed_over_1": "#ffff40",
"tab_missed_over_2": "#ff9933",
"tab_missed_over_3": "#ff0000",
"tab_title_2": "#000000",
"ansi": [
"#3b4252",
"#bf616a",
"#a3be8c",
"#ebcb8b",
"#81a1c1",
"#b48ead",
"#88c0d0",
"#e5e9f8",
"#4c566a",
"#bf616a",
"#a3be8c",
"#ebcb8b",
"#81a1c1",
"#b48ead",
"#8fbcbb",
"#eceff4"
]
}

View File

@ -0,0 +1,42 @@
[Main]
version = 1
[Metadata]
version = 1
name = Ocean Dark
author = Chris Kempson
website = https://github.com/chriskempson/base16-builder/blob/master/schemes/ocean.yml
license = MIT
[Colors]
def = #c0c5ce
bg = #2b303b
fg = #c0c5ce
main = #3399ff
hl = #ffffff
end_sel = #ff0000
tab_missed_1 = #ff9933
tab_missed_2 = #ff3300
tab_missed_3 = #ff0000
tab_missed_over_1 = #ffff33
tab_missed_over_2 = #ff9933
tab_missed_over_3 = #ff0000
tab_title_2 = #000000
[Ansi]
ansi00 = #2b303b
ansi01 = #bf616a
ansi02 = #a3be8c
ansi03 = #ebcb8b
ansi04 = #8ba1b3
ansi05 = #b48ead
ansi06 = #96b5b4
ansi07 = #c0c5ce
ansi08 = #65737e
ansi09 = #d08770
ansi10 = #343d46
ansi11 = #4f5b66
ansi12 = #a7adba
ansi13 = #dfe1e8
ansi14 = #ab7967
ansi15 = #eff1f5

View File

@ -1,41 +0,0 @@
{
"version": 1,
"md": {
"version": 1,
"name": "Ocean Dark",
"author": "Chris Kempson",
"website": "https://github.com/chriskempson/base16-builder/blob/master/schemes/ocean.yml",
"license": "MIT"
},
"def": "#c0c5ce",
"bg": "#2b303b",
"fg": "#c0c5ce",
"main": "#3399ff",
"hl": "#ffffff",
"end_sel": "#ff0000",
"tab_missed_1": "#ff9933",
"tab_missed_2": "#ff3300",
"tab_missed_3": "#ff0000",
"tab_missed_over_1": "#ffff33",
"tab_missed_over_2": "#ff9933",
"tab_missed_over_3": "#ff0000",
"tab_title_2": "#000000",
"ansi": [
"#2b303b",
"#bf616a",
"#a3be8c",
"#ebcb8b",
"#8ba1b3",
"#b48ead",
"#96b5b4",
"#c0c5ce",
"#65737e",
"#d08770",
"#343d46",
"#4f5b66",
"#a7adba",
"#dfe1e8",
"#ab7967",
"#eff1f5"
]
}

View File

@ -0,0 +1,42 @@
[Main]
version = 1
[Metadata]
version = 1
name = PaperColor
author = Nikyle Nguyen
website = https://github.com/NLKNguyen/papercolor-theme
license = MIT
[Colors]
def = #444444
bg = #eeeeee
fg = #444444
main = #ff0266
hl = #ffffff
end_sel = #88003d
tab_missed_1 = #ff9933
tab_missed_2 = #ff3300
tab_missed_3 = #ff0000
tab_missed_over_1 = #ffff40
tab_missed_over_2 = #ff9933
tab_missed_over_3 = #ff0000
tab_title_2 = #000000
[Ansi]
ansi00 = #f2f2f2
ansi01 = #c62828
ansi02 = #558b2e
ansi03 = #ff8f01
ansi04 = #1565c0
ansi05 = #6a1e9a
ansi06 = #00838f
ansi07 = #2c2c2c
ansi08 = #fbfbdb
ansi09 = #e17e85
ansi10 = #61ba86
ansi11 = #ffb68e
ansi12 = #4cb2ff
ansi13 = #be86e3
ansi14 = #2dced0
ansi15 = #546386

View File

@ -1,41 +0,0 @@
{
"version": 1,
"md": {
"version": 1,
"name": "PaperColor",
"author": "Nikyle Nguyen",
"website": "https://github.com/NLKNguyen/papercolor-theme",
"license": "MIT"
},
"def": "#444444",
"bg": "#eeeeee",
"fg": "#444444",
"main": "#ff0266",
"hl": "#ffffff",
"end_sel": "#88003d",
"tab_missed_1": "#ff9933",
"tab_missed_2": "#ff3300",
"tab_missed_3": "#ff0000",
"tab_missed_over_1": "#ffff40",
"tab_missed_over_2": "#ff9933",
"tab_missed_over_3": "#ff0000",
"tab_title_2": "#000000",
"ansi": [
"#f2f2f2",
"#c62828",
"#558b2e",
"#ff8f01",
"#1565c0",
"#6a1e9a",
"#00838f",
"#2c2c2c",
"#fbfbdb",
"#e17e85",
"#61ba86",
"#ffb68e",
"#4cb2ff",
"#be86e3",
"#2dced0",
"#546386"
]
}

View File

@ -0,0 +1,42 @@
[Main]
version = 1
[Metadata]
version = 1
name = Smyck
author = John-Paul Bader (hukl)
website = http://color.smyck.ork/
license = MIT
[Colors]
def = #aaaaaa
bg = #000000
fg = #aaaaaa
main = #3399ff
hl = #ffffff
end_sel = #ff0000
tab_missed_1 = #ff9933
tab_missed_2 = #ff3300
tab_missed_3 = #ff0000
tab_missed_over_1 = #ffff33
tab_missed_over_2 = #ff9933
tab_missed_over_3 = #ff0000
tab_title_2 = #000000
[Ansi]
ansi00 = #000000
ansi01 = #c75646
ansi02 = #8eb33b
ansi03 = #d0b03c
ansi04 = #4e90a7
ansi05 = #c8a0d1
ansi06 = #218693
ansi07 = #b0b0b0
ansi08 = #5d5d5d
ansi09 = #e09690
ansi10 = #cdee69
ansi11 = #ffe377
ansi12 = #9cd9f0
ansi13 = #fbb1f9
ansi14 = #77dfd8
ansi15 = #f7f7f7

View File

@ -1,41 +0,0 @@
{
"version": 1,
"md": {
"version": 1,
"name": "Smyck",
"author": "John-Paul Bader (hukl)",
"website": "http://color.smyck.ork/",
"license": "MIT"
},
"def": "#aaaaaa",
"bg": "#000000",
"fg": "#aaaaaa",
"main": "#3399ff",
"hl": "#ffffff",
"end_sel": "#ff0000",
"tab_missed_1": "#ff9933",
"tab_missed_2": "#ff3300",
"tab_missed_3": "#ff0000",
"tab_missed_over_1": "#ffff33",
"tab_missed_over_2": "#ff9933",
"tab_missed_over_3": "#ff0000",
"tab_title_2": "#000000",
"ansi": [
"#000000",
"#c75646",
"#8eb33b",
"#d0b03c",
"#4e90a7",
"#c8a0d1",
"#218693",
"#b0b0b0",
"#5d5d5d",
"#e09690",
"#cdee69",
"#ffe377",
"#9cd9f0",
"#fbb1f9",
"#77dfd8",
"#f7f7f7"
]
}

View File

@ -0,0 +1,42 @@
[Main]
version = 1
[Metadata]
version = 1
name = Solarized Light
author = Ethan Schoonover
website = https://ethanschoonover.com/solarized/
license = MIT
[Colors]
def = #839496
bg = #fdf6e3
fg = #002b36
main = #3399ff
hl = #ffffff
end_sel = #ff0000
tab_missed_1 = #ff9933
tab_missed_2 = #ff3300
tab_missed_3 = #ff0000
tab_missed_over_1 = #ffff33
tab_missed_over_2 = #ff9933
tab_missed_over_3 = #ff0000
tab_title_2 = #000000
[Ansi]
ansi00 = #002b36
ansi01 = #dc322f
ansi02 = #859900
ansi03 = #b58900
ansi04 = #268bd2
ansi05 = #d33682
ansi06 = #2aa198
ansi07 = #eee8d5
ansi08 = #073642
ansi09 = #cb4b16
ansi10 = #586e75
ansi11 = #657b83
ansi12 = #839496
ansi13 = #6c71c4
ansi14 = #93a1a1
ansi15 = #fdf6e3

View File

@ -1,41 +0,0 @@
{
"version": 1,
"md": {
"version": 1,
"name": "Solarized Light",
"author": "Ethan Schoonover",
"website": "https://ethanschoonover.com/solarized/",
"license": "MIT"
},
"def": "#839496",
"bg": "#fdf6e3",
"fg": "#002b36",
"main": "#3399ff",
"hl": "#ffffff",
"end_sel": "#ff0000",
"tab_missed_1": "#ff9933",
"tab_missed_2": "#ff3300",
"tab_missed_3": "#ff0000",
"tab_missed_over_1": "#ffff33",
"tab_missed_over_2": "#ff9933",
"tab_missed_over_3": "#ff0000",
"tab_title_2": "#000000",
"ansi": [
"#002b36",
"#dc322f",
"#859900",
"#b58900",
"#268bd2",
"#d33682",
"#2aa198",
"#eee8d5",
"#073642",
"#cb4b16",
"#586e75",
"#657b83",
"#839496",
"#6c71c4",
"#93a1a1",
"#fdf6e3"
]
}

View File

@ -0,0 +1,42 @@
[Main]
version = 1
[Metadata]
version = 1
name = Solarized
author = Ethan Schoonover
website = https://ethanschoonover.com/solarized/
license = MIT
[Colors]
def = #839496
bg = #002b36
fg = #fdf6e3
main = #3399ff
hl = #ffffff
end_sel = #ff0000
tab_missed_1 = #ff9933
tab_missed_2 = #ff3300
tab_missed_3 = #ff0000
tab_missed_over_1 = #ffff33
tab_missed_over_2 = #ff9933
tab_missed_over_3 = #ff0000
tab_title_2 = #000000
[Ansi]
ansi00 = #073642
ansi01 = #dc322f
ansi02 = #859900
ansi03 = #b58900
ansi04 = #268bd2
ansi05 = #d33682
ansi06 = #2aa198
ansi07 = #eee8d5
ansi08 = #002b36
ansi09 = #cb4b16
ansi10 = #586e75
ansi11 = #657b83
ansi12 = #839496
ansi13 = #6c71c4
ansi14 = #93a1a1
ansi15 = #fdf6e3

View File

@ -1,41 +0,0 @@
{
"version": 1,
"md": {
"version": 1,
"name": "Solarized",
"author": "Ethan Schoonover",
"website": "https://ethanschoonover.com/solarized/",
"license": "MIT"
},
"def": "#839496",
"bg": "#002b36",
"fg": "#fdf6e3",
"main": "#3399ff",
"hl": "#ffffff",
"end_sel": "#ff0000",
"tab_missed_1": "#ff9933",
"tab_missed_2": "#ff3300",
"tab_missed_3": "#ff0000",
"tab_missed_over_1": "#ffff33",
"tab_missed_over_2": "#ff9933",
"tab_missed_over_3": "#ff0000",
"tab_title_2": "#000000",
"ansi": [
"#073642",
"#dc322f",
"#859900",
"#b58900",
"#268bd2",
"#d33682",
"#2aa198",
"#eee8d5",
"#002b36",
"#cb4b16",
"#586e75",
"#657b83",
"#839496",
"#6c71c4",
"#93a1a1",
"#fdf6e3"
]
}

View File

@ -8,19 +8,19 @@ EET=$1
shift
OUTPUT=$1
shift
JSON2DESC=$(dirname "$0")/json2desc.py
INI2DESC=$(dirname "$0")/ini2desc.py
# work on a temporary file till every insertion worked
TMP_EET=$(mktemp "$OUTPUT-XXXXXX")
# trap to avoid creating orphan files
trap 'rm -f "$TMPFILE"' INT TERM HUP EXIT
for JSON in "$@"
for INI in "$@"
do
# use the name, without extension as key in eet
KEY=$(basename "$JSON" ".json")
KEY=$(basename "$INI" ".ini")
DESC="${KEY}.desc"
$JSON2DESC "$JSON" "$DESC"
$INI2DESC "$INI" "$DESC"
$EET -e "$TMP_EET" "$KEY" "$DESC" "$COMPRESS"
done

View File

@ -1,33 +1,40 @@
#!/usr/bin/env python3
import argparse
import json
import configparser
parser = argparse.ArgumentParser(description='Convert JSON colorschemes to EET description files.')
parser = argparse.ArgumentParser(description='Convert INI colorschemes to EET description files.')
parser.add_argument('input_file',
type=argparse.FileType('r'),
help='JSON File to convert')
help='INI File to convert')
parser.add_argument('output_file',
type=argparse.FileType('w'),
help='EET description to write')
args = parser.parse_args()
d = json.load(args.input_file)
cfg = configparser.ConfigParser()
cfg.read_file(args.input_file)
out = args.output_file
print(cfg.sections())
assert(int(cfg['Main']['version']) == 1)
out.write('group "Color_Scheme" struct {\n')
out.write(' value "version" int: {};\n'
.format(d['version']))
.format(cfg['Main']['version']))
out.write(' value "md.version" int: {};\n'
.format(d['md']['version']))
.format(cfg['Metadata']['version']))
out.write(' value "md.name" string: "{}";\n'
.format(d['md']['name']))
.format(cfg['Metadata']['name']))
out.write(' value "md.author" string: "{}";\n'
.format(d['md']['author']))
.format(cfg['Metadata']['author']))
out.write(' value "md.website" string: "{}";\n'
.format(d['md']['website']))
.format(cfg['Metadata']['website']))
out.write(' value "md.license" string: "{}";\n'
.format(d['md']['license']))
.format(cfg['Metadata']['license']))
def parse_color(color_string):
h = color_string.lstrip('#')
@ -49,13 +56,11 @@ def write_color(color_string):
out.write(' value "a" uchar: {};\n'.format(a))
out.write(' }\n')
def write_name_color(color_name):
out.write(' group "{}" struct {{\n'.format(color_name))
write_color(d[color_name])
write_color(cfg['Colors'][color_name])
out.write(' }\n')
write_name_color('def')
write_name_color('bg')
write_name_color('fg')
@ -71,12 +76,11 @@ write_name_color('tab_missed_over_3')
write_name_color('tab_title_2')
def write_ansi():
assert(len(d['ansi']) == 16)
out.write(' group "ansi" array {\n')
out.write(' count 16;\n')
for c in d['ansi']:
write_color(c)
out.write(' }\n')
for c in range(15):
write_color(cfg['Ansi']['ansi{0:02d}'.format(c)])
out.write(' }\n')
write_ansi()
out.write('}\n')

View File

@ -1,12 +1,12 @@
colorschemes_desc = [
'Mild.json',
'Mustang.json',
'Nord.json',
'Ocean Dark.json',
'PaperColor.json',
'Smyck.json',
'Solarized.json',
'Solarized Light.json',
'Mild.ini',
'Mustang.ini',
'Nord.ini',
'Ocean Dark.ini',
'PaperColor.ini',
'Smyck.ini',
'Solarized.ini',
'Solarized Light.ini',
]
cs_builder = [join_paths(meson.source_root(),
'data', 'colorschemes', 'builder.sh'),
@ -19,7 +19,7 @@ custom_target('colorschemes.eet',
install:true,
install_dir: cs_install_dir,
install_mode: 'rw-r--r--',
depend_files: ['builder.sh', 'json2desc.py'],
depend_files: ['builder.sh', 'ini2desc.py'],
command: cs_builder,
input: colorschemes_desc,
output: 'colorschemes.eet')