From f057c08d1e5ed4155418ccb0afedf1c26d82751a Mon Sep 17 00:00:00 2001 From: Seth Holland Date: Mon, 25 May 2020 00:09:35 -0500 Subject: Add decimal output support --- pywal/util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pywal/util.py b/pywal/util.py index fb04c92..1fdae31 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -48,6 +48,16 @@ class Color: """Export the alpha value as a decimal number in [0, 1].""" 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.""" -- cgit v1.2.3