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

Commit 7fae8d2

Browse files
authored
Merge pull request #529 from sholland1/decimal
Add decimal output support
2 parents ad9b05b + f057c08 commit 7fae8d2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pywal/util.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ def alpha_dec(self):
4848
"""Export the alpha value as a decimal number in [0, 1]."""
4949
return int(self.alpha_num) / 100
5050

51+
@property
52+
def decimal(self):
53+
"""Export color in decimal."""
54+
return "%s%s" % ("#", int(self.hex_color[1:], 16))
55+
56+
@property
57+
def decimal_strip(self):
58+
"""Strip '#' from decimal color."""
59+
return int(self.hex_color[1:], 16)
60+
5161
@property
5262
def octal(self):
5363
"""Export color in octal."""

0 commit comments

Comments
 (0)