From dafaa06389239db609f6c28b657e3ee88717bb22 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 3 Mar 2018 16:58:01 +1100 Subject: export: Added octal support. Closes #193 --- pywal/util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pywal/util.py b/pywal/util.py index acca2f7..43ee3fb 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -32,6 +32,16 @@ class Color: """Add URxvt alpha value to color.""" return "[%s]%s" % (self.alpha_num, self.hex_color) + @property + def octal(self): + """Export color in octal""" + return "%s%s" % ("#", oct(int(self.hex_color[1:], 16))[2:]) + + @property + def octal_strip(self): + """Strip '#' from octal color.""" + return oct(int(self.hex_color[1:], 16))[2:] + @property def strip(self): """Strip '#' from color.""" -- cgit v1.2.3