xiwal

Generate terminal color schemes
git clone https://git.ce9e.org/xiwal.git

commit
b2eb3bd99cacb011f87ce1590b94f2dd47901feb
parent
b6f19fa93a8bee083ccba40f29f74318d640b156
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-11-15 07:23
wip: allow to generate schema based on existing colors

Diffstat

M xiwal.py 11 +++++++++++

1 files changed, 11 insertions, 0 deletions


diff --git a/xiwal.py b/xiwal.py

@@ -193,9 +193,20 @@ def palette(scheme):
  193   193 	print(''.join(s[8:]))
  194   194 
  195   195 
   -1   196 def parse_hex(s):
   -1   197 	r = int(s[1:3], 16)
   -1   198 	g = int(s[3:5], 16)
   -1   199 	b = int(s[5:7], 16)
   -1   200 	return r, g, b
   -1   201 
   -1   202 solarized = ['#002b36', '#eee8d5', '#b58900', '#cb4b16', '#dc322f', '#d33682', '#6c71c4', '#268bd2', '#2aa198', '#859900']
   -1   203 gruvbox = ['#3c3836', '#cc241d', '#98971a', '#d79921', '#458588', '#b16286', '#689d6a', '#d65d0e']
   -1   204 
   -1   205 
  196   206 if __name__ == '__main__':
  197   207 	# foo
  198   208 	colors = list(im(sys.argv[1]))
   -1   209 	# colors = [parse_hex(c) for c in gruvbox]
  199   210 	subprocess.call(['chafa', '-s', '40', sys.argv[1]])
  200   211 	scheme = colors2scheme(colors)
  201   212 	print(';'.join(scheme))