diff options
| author | Martin Patz <martin@recogni.com> | 2020-03-23 01:01:32 +0100 |
|---|---|---|
| committer | Martin Patz <martin@recogni.com> | 2020-03-23 01:01:32 +0100 |
| commit | 52d1f5e7d491ab13310ea7ab722d65429d655229 (patch) | |
| tree | 012cc7c720e1decb0a79b1ed43957991508489b9 | |
| parent | ee50fb3ab394a117295acdfe0fa9b149c280942a (diff) | |
exposes the alpha value as a decimal as well
| -rw-r--r-- | pywal/util.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pywal/util.py b/pywal/util.py index 7a6787e..76a364b 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -36,7 +36,7 @@ class Color: def rgba(self): """Convert a hex color to rgba.""" return "rgba(%s,%s,%s,%s)" % (*hex_to_rgb(self.hex_color), - int(self.alpha_num) / 100) + self.alpha_dec) @property def alpha(self): @@ -44,6 +44,10 @@ class Color: return "[%s]%s" % (self.alpha_num, self.hex_color) @property + def alpha_dec(self): + return int(self.alpha_num) / 100 + + @property def octal(self): """Export color in octal""" return "%s%s" % ("#", oct(int(self.hex_color[1:], 16))[2:]) |
