Skip to content

Commit 681b451

Browse files
chrishoageeylles
authored andcommitted
add support for alpha_hex
1 parent ab83015 commit 681b451

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pywal/util.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ def alpha_dec(self):
5454
"""Export the alpha value as a decimal number in [0, 1]."""
5555
return int(self.alpha_num) / 100
5656

57+
@property
58+
def alpha_hex(self):
59+
"""Export the alpha value as a hexdecimal number in [00, FF]."""
60+
return "%02X" % (int(int(self.alpha_num) * 255 / 100))
61+
5762
@property
5863
def decimal(self):
5964
"""Export color in decimal."""

0 commit comments

Comments
 (0)