From 9de88ad3b84d6211df5e8174db5c8b71a3bd3811 Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Thu, 29 Jun 2017 16:47:13 +0200 Subject: template: refactor to allow {color1.rgb} notation and remove putty exception --- pywal/util.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pywal/util.py') diff --git a/pywal/util.py b/pywal/util.py index 69a9d9d..820be10 100755 --- a/pywal/util.py +++ b/pywal/util.py @@ -51,3 +51,14 @@ def disown(*cmd): stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, preexec_fn=os.setpgrp) + +class Color(object): + def __init__(self, hex): + self.hex = hex + + def __str__(self): + return self.hex + + @property + def rgb(self): + return hex_to_rgb(self.hex) -- cgit v1.2.3