diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2019-01-04 21:56:49 +0200 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2019-01-04 21:56:49 +0200 |
| commit | 1e416a18a853159f3473d80c831322630d006bb1 (patch) | |
| tree | b8267359ec1f7e09441667a39c434d5264c09227 /pywal/util.py | |
| parent | 30af3d0d5c9b8c5e712b571ec605102895f2e06b (diff) | |
export: Added rgba support. Closes #352
Diffstat (limited to 'pywal/util.py')
| -rw-r--r-- | pywal/util.py | 6 |
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) |
