From 1e8165e71bc34c44730cd1fcc0ab36205fbc6248 Mon Sep 17 00:00:00 2001 From: Mitch Weaver <20451170+MitchWeaver@users.noreply.github.com> Date: Thu, 1 Mar 2018 01:07:49 +0100 Subject: [PATCH] add octal output support --- pywal/util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pywal/util.py b/pywal/util.py index acca2f7..66332af 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -37,6 +37,16 @@ class Color: """Strip '#' from color.""" return self.hex_color[1:] + @property + def octal(self): + """Export color in octal""" + return '#' + 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:] + def read_file(input_file): """Read data from a file and trim newlines."""