Removed standard colors 0-15 for portability. Removed pygments dep. Fixed setup.py
This commit is contained in:
parent
76579920ef
commit
5e763123f8
11 changed files with 109 additions and 117 deletions
13
resolvecolor.py
Executable file
13
resolvecolor.py
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os, sys, argparse, os.path, json, re
|
||||
import xtermcolors
|
||||
|
||||
# Resolve HTML-style hex RGB color codes to xterm-256color color numbers
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
print('Usage: resolvecolor.py #RRGGBB')
|
||||
exit()
|
||||
|
||||
print(xtermcolors.closest_color(*[int(s, 16) for s in re.match('#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})', sys.argv[1]).groups()]))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue