diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2017-06-30 10:15:59 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2017-06-30 10:15:59 +1000 |
| commit | 23571cc6207ec825749e4d999993b4a2568975b6 (patch) | |
| tree | 1459f29e60ffdd904706e9027f06250a46d1042c /pywal | |
| parent | 930c3c8e40ca5c563d0414e5057b23ad27aa7cf3 (diff) | |
general: Rename set_colors to sequences
Diffstat (limited to 'pywal')
| -rwxr-xr-x | pywal/__main__.py | 6 | ||||
| -rwxr-xr-x | pywal/gen_colors.py | 3 | ||||
| -rwxr-xr-x | pywal/sequences.py (renamed from pywal/set_colors.py) | 16 | ||||
| -rwxr-xr-x | pywal/util.py | 16 |
4 files changed, 20 insertions, 21 deletions
diff --git a/pywal/__main__.py b/pywal/__main__.py index 2cf6c32..9c1d000 100755 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -11,7 +11,7 @@ from pywal.settings import CACHE_DIR, __version__ from pywal import export from pywal import image from pywal import gen_colors -from pywal import set_colors +from pywal import sequences from pywal import reload from pywal import wallpaper from pywal import util @@ -79,7 +79,7 @@ def process_args(args): # -r if args.r: - set_colors.reload_colors(args.t) + sequences.reload_colors(args.t) # -v if args.v: @@ -102,7 +102,7 @@ def process_args(args): # -i or -f if args.i or args.f: - set_colors.send_sequences(colors_plain, args.t) + sequences.send_sequences(colors_plain, args.t) export.export_all_templates(colors_plain) reload.reload_env() diff --git a/pywal/gen_colors.py b/pywal/gen_colors.py index 7dd95b5..3006c72 100755 --- a/pywal/gen_colors.py +++ b/pywal/gen_colors.py @@ -6,7 +6,6 @@ import shutil import subprocess from pywal.settings import CACHE_DIR, COLOR_COUNT -from pywal import set_colors from pywal import util @@ -97,7 +96,7 @@ def sort_colors(colors): for index, color in enumerate(raw_colors)] # Color 8 - colors_hex["color8"] = set_colors.set_grey(raw_colors) + colors_hex["color8"] = util.set_grey(raw_colors) # Add the colors to a dict. colors = {} diff --git a/pywal/set_colors.py b/pywal/sequences.py index 756aa34..eb51497 100755 --- a/pywal/set_colors.py +++ b/pywal/sequences.py @@ -18,22 +18,6 @@ def set_color(index, color): return f"\033]4;{index};{color}\007" -def set_grey(colors): - """Set a grey color based on brightness of color0.""" - return { - 0: "#666666", - 1: "#666666", - 2: "#757575", - 3: "#999999", - 4: "#999999", - 5: "#8a8a8a", - 6: "#a1a1a1", - 7: "#a1a1a1", - 8: "#a1a1a1", - 9: "#a1a1a1", - }.get(int(colors[0][1]), colors[7]) - - def send_sequences(colors, vte): """Send colors to all open terminals.""" diff --git a/pywal/util.py b/pywal/util.py index 0b4977b..97fe03d 100755 --- a/pywal/util.py +++ b/pywal/util.py @@ -22,6 +22,22 @@ class Color(object): return hex_to_rgb(self.hex_color) +def set_grey(colors): + """Set a grey color based on brightness of color0.""" + return { + 0: "#666666", + 1: "#666666", + 2: "#757575", + 3: "#999999", + 4: "#999999", + 5: "#8a8a8a", + 6: "#a1a1a1", + 7: "#a1a1a1", + 8: "#a1a1a1", + 9: "#a1a1a1", + }.get(int(colors[0][1]), colors[7]) + + def read_file(input_file): """Read colors from a file.""" with open(input_file) as file: |
