Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 52d1f5e

Browse files
author
Martin Patz
committed
exposes the alpha value as a decimal as well
1 parent ee50fb3 commit 52d1f5e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pywal/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,17 @@ def xrgba(self):
3636
def rgba(self):
3737
"""Convert a hex color to rgba."""
3838
return "rgba(%s,%s,%s,%s)" % (*hex_to_rgb(self.hex_color),
39-
int(self.alpha_num) / 100)
39+
self.alpha_dec)
4040

4141
@property
4242
def alpha(self):
4343
"""Add URxvt alpha value to color."""
4444
return "[%s]%s" % (self.alpha_num, self.hex_color)
4545

46+
@property
47+
def alpha_dec(self):
48+
return int(self.alpha_num) / 100
49+
4650
@property
4751
def octal(self):
4852
"""Export color in octal"""

0 commit comments

Comments
 (0)