summaryrefslogtreecommitdiff
path: root/pywal
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-07-01 19:45:53 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-07-01 19:45:53 +1000
commit0425f1d8aa0de1f499d6e93b731f193994f59902 (patch)
tree324d35a53ecc798b9facaf91578e4610400dcd31 /pywal
parent0f6b48523ca188f9085b6d3295345c53b75aed20 (diff)
util: Fix set_grey type mismatch.
Diffstat (limited to 'pywal')
-rw-r--r--pywal/export.py6
-rw-r--r--pywal/util.py22
2 files changed, 14 insertions, 14 deletions
diff --git a/pywal/export.py b/pywal/export.py
index dce39d4..5e7f2e6 100644
--- a/pywal/export.py
+++ b/pywal/export.py
@@ -10,9 +10,6 @@ from pywal import util
def template(colors, input_file, output_dir):
"""Read template file, substitute markers and
save the file elsewhere."""
- # Get the template name.
- template_file = os.path.basename(input_file)
-
# Import the template.
with open(input_file) as file:
template_data = file.readlines()
@@ -20,6 +17,9 @@ def template(colors, input_file, output_dir):
# Format the markers.
template_data = "".join(template_data).format(**colors)
+ # Get the template name.
+ template_file = os.path.basename(input_file)
+
# Export the template.
output_file = output_dir / template_file
util.save_file(template_data, output_file)
diff --git a/pywal/util.py b/pywal/util.py
index 97fe03d..8bfd676 100644
--- a/pywal/util.py
+++ b/pywal/util.py
@@ -25,17 +25,17 @@ class Color(object):
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])
+ "0": "#666666",
+ "1": "#666666",
+ "2": "#757575",
+ "3": "#999999",
+ "4": "#999999",
+ "5": "#8a8a8a",
+ "6": "#a1a1a1",
+ "7": "#a1a1a1",
+ "8": "#a1a1a1",
+ "9": "#a1a1a1",
+ }.get(colors[0][1], colors[7])
def read_file(input_file):