aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <[email protected]>2019-01-04 21:56:49 +0200
committerDylan Araps <[email protected]>2019-01-04 21:56:49 +0200
commit1e416a18a853159f3473d80c831322630d006bb1 (patch)
treeb8267359ec1f7e09441667a39c434d5264c09227
parentsettings: Added ENVAR PYWAL_CACHE_DIR to change cache dir. Closes #343 (diff)
downloadpywal-1e416a18a853159f3473d80c831322630d006bb1.tar.xz
pywal-1e416a18a853159f3473d80c831322630d006bb1.zip
export: Added rgba support. Closes #352
-rw-r--r--pywal/util.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pywal/util.py b/pywal/util.py
index 0557cc4..de8eb09 100644
--- a/pywal/util.py
+++ b/pywal/util.py
@@ -30,6 +30,12 @@ class Color:
return hex_to_xrgba(self.hex_color)
@property
+ def rgba(self):
+ """Convert a hex color to rgba."""
+ return "rgba(%s,%s,%s,%s)" % (*hex_to_rgb(self.hex_color),
+ int(self.alpha_num)/100)
+
+ @property
def alpha(self):
"""Add URxvt alpha value to color."""
return "[%s]%s" % (self.alpha_num, self.hex_color)