diff options
| author | Dylan Araps <[email protected]> | 2018-03-03 16:58:01 +1100 |
|---|---|---|
| committer | Dylan Araps <[email protected]> | 2018-03-03 16:58:01 +1100 |
| commit | dafaa06389239db609f6c28b657e3ee88717bb22 (patch) | |
| tree | 37d7db67140ee065128cdd30808478b8e6942013 | |
| parent | sequences: Fix terminal highlight. Closes #190 (diff) | |
| download | pywal-dafaa06389239db609f6c28b657e3ee88717bb22.tar.xz pywal-dafaa06389239db609f6c28b657e3ee88717bb22.zip | |
export: Added octal support. Closes #193
| -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:] |