From 10e716ca907366ac7198e08c4a7340688ef5258e Mon Sep 17 00:00:00 2001 From: Chris Hoage Date: Fri, 8 Jan 2021 17:08:21 -0800 Subject: [PATCH] add support for alpha_hex --- pywal/util.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pywal/util.py b/pywal/util.py index 0a91ca2..e00c033 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -54,6 +54,11 @@ class Color: """Export the alpha value as a decimal number in [0, 1].""" return int(self.alpha_num) / 100 + @property + def alpha_hex(self): + """Export the alpha value as a hexdecimal number in [00, FF].""" + return "%02X" % (int(int(self.alpha_num) * 255 / 100)) + @property def decimal(self): """Export color in decimal."""