Skip to content

Commit

Permalink
add support for alpha_hex
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishoage authored and eylles committed Mar 11, 2022
1 parent ab83015 commit 681b451
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pywal/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def alpha_dec(self):
"""Export the alpha value as a decimal number in [0, 1]."""
return int(self.alpha_num) / 100

@property
def alpha_hex(self):
"""Export the alpha value as a hexdecimal number in [00, FF]."""
return "%02X" % (int(int(self.alpha_num) * 255 / 100))

@property
def decimal(self):
"""Export color in decimal."""
Expand Down

0 comments on commit 681b451

Please sign in to comment.