From f91237f5abb84b2481ede1a2cb7474e619c5deb5 Mon Sep 17 00:00:00 2001 From: Chris Hoage Date: Fri, 8 Jan 2021 16:31:18 -0800 Subject: [PATCH] add support for hex_argb --- pywal/util.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pywal/util.py b/pywal/util.py index 1fdae31..0a91ca2 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -38,6 +38,12 @@ class Color: return "rgba(%s,%s,%s,%s)" % (*hex_to_rgb(self.hex_color), self.alpha_dec) + @property + def hex_argb(self): + """Convert an alpha hex color to argb hex.""" + return "#%02X%s" % (int(int(self.alpha_num) * 255 / 100), + self.hex_color[1:]) + @property def alpha(self): """Add URxvt alpha value to color."""