summaryrefslogtreecommitdiff
path: root/pywal/util.py
diff options
context:
space:
mode:
authorDylan Araps <dylanaraps@users.noreply.github.com>2017-07-23 18:47:37 +1000
committerGitHub <noreply@github.com>2017-07-23 18:47:37 +1000
commit8d7728db582ce3608beabaedcf2ff94b216bb8fb (patch)
tree060cd1093d3badd5b4ca991bdf0f138245737da7 /pywal/util.py
parent72d0ca4e2f4be7969498b226af4243315f2dff0c (diff)
parentbc97a5e165326da6bb9c9a5bb7b58d40f4cd594e (diff)
Merge pull request #54 from dylanaraps/alpha
general: Add back -a to support transparency in URxvt.
Diffstat (limited to 'pywal/util.py')
-rw-r--r--pywal/util.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pywal/util.py b/pywal/util.py
index 1df3c9f..25a36a4 100644
--- a/pywal/util.py
+++ b/pywal/util.py
@@ -9,6 +9,8 @@ import subprocess
class Color:
"""Color formats."""
+ alpha_num = 100
+
def __init__(self, hex_color):
self.hex_color = hex_color
@@ -25,6 +27,11 @@ class Color:
"""Convert a hex color to xrdb rgba."""
return hex_to_xrgba(self.hex_color)
+ @property
+ def alpha(self):
+ """Add URxvt alpha value to color."""
+ return f"[{self.alpha_num}]{self.hex_color}"
+
def set_grey(colors):
"""Set a grey color based on the brightness