From 52d1f5e7d491ab13310ea7ab722d65429d655229 Mon Sep 17 00:00:00 2001 From: Martin Patz Date: Mon, 23 Mar 2020 01:01:32 +0100 Subject: exposes the alpha value as a decimal as well --- pywal/util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pywal/util.py b/pywal/util.py index 7a6787e..76a364b 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -36,13 +36,17 @@ 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): """Add URxvt alpha value to 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""" -- cgit v1.2.3