summaryrefslogtreecommitdiff
path: root/pywal
diff options
context:
space:
mode:
authordylan <dylan.araps@gmail.com>2020-05-25 08:29:25 +0300
committerGitHub <noreply@github.com>2020-05-25 08:29:25 +0300
commit7fae8d23f5b7b8a58694025c0a952a27b6a1ffcd (patch)
tree32f8e04a50866f5f967e601728a3e5b3f63bbcad /pywal
parentad9b05ba93b1bdd88e15d4c5ef66447719985b79 (diff)
parentf057c08d1e5ed4155418ccb0afedf1c26d82751a (diff)
Merge pull request #529 from sholland1/decimal
Add decimal output support
Diffstat (limited to 'pywal')
-rw-r--r--pywal/util.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pywal/util.py b/pywal/util.py
index fb04c92..1fdae31 100644
--- a/pywal/util.py
+++ b/pywal/util.py
@@ -49,6 +49,16 @@ class Color:
return int(self.alpha_num) / 100
@property
+ def decimal(self):
+ """Export color in decimal."""
+ return "%s%s" % ("#", int(self.hex_color[1:], 16))
+
+ @property
+ def decimal_strip(self):
+ """Strip '#' from decimal color."""
+ return int(self.hex_color[1:], 16)
+
+ @property
def octal(self):
"""Export color in octal."""
return "%s%s" % ("#", oct(int(self.hex_color[1:], 16))[2:])