diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2018-03-03 16:58:01 +1100 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2018-03-03 16:58:01 +1100 |
| commit | dafaa06389239db609f6c28b657e3ee88717bb22 (patch) | |
| tree | 37d7db67140ee065128cdd30808478b8e6942013 /pywal | |
| parent | 39e5ab295b7e898316c15dcc52717528dc2a52b0 (diff) | |
export: Added octal support. Closes #193
Diffstat (limited to 'pywal')
| -rw-r--r-- | pywal/util.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pywal/util.py b/pywal/util.py index acca2f7..43ee3fb 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -33,6 +33,16 @@ class 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.""" return self.hex_color[1:] |
