diff options
| author | Seth Holland <holland_s91@yahoo.com> | 2020-05-25 00:09:35 -0500 |
|---|---|---|
| committer | Seth Holland <holland_s91@yahoo.com> | 2020-05-25 00:09:35 -0500 |
| commit | f057c08d1e5ed4155418ccb0afedf1c26d82751a (patch) | |
| tree | 32f8e04a50866f5f967e601728a3e5b3f63bbcad | |
| parent | ad9b05ba93b1bdd88e15d4c5ef66447719985b79 (diff) | |
Add decimal output support
| -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 fb04c92..1fdae31 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -49,6 +49,16 @@ class Color: 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.""" return "%s%s" % ("#", oct(int(self.hex_color[1:], 16))[2:]) |
