From 83a0f6945d08124a1c763151ce4f7f65443414f9 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 23 Jul 2017 18:37:05 +1000 Subject: general: Add -a to support terminal transparency. --- pywal/util.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pywal/util.py') diff --git a/pywal/util.py b/pywal/util.py index 1df3c9f..25a36a4 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -9,6 +9,8 @@ import subprocess class Color: """Color formats.""" + alpha_num = 100 + def __init__(self, hex_color): self.hex_color = hex_color @@ -25,6 +27,11 @@ class Color: """Convert a hex color to xrdb rgba.""" return hex_to_xrgba(self.hex_color) + @property + def alpha(self): + """Add URxvt alpha value to color.""" + return f"[{self.alpha_num}]{self.hex_color}" + def set_grey(colors): """Set a grey color based on the brightness -- cgit v1.2.3