Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 8e6f6d3

Browse files
committed
Merge branch 'master' of ssh://github.com/dylanaraps/pywal
2 parents 27dff31 + 94b0ca5 commit 8e6f6d3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pywal/util.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ def strip(self):
5858
"""Strip '#' from color."""
5959
return self.hex_color[1:]
6060

61+
@property
62+
def red(self):
63+
"""Red value as float between 0 and 1."""
64+
return "%.3f" % (hex_to_rgb(self.hex_color)[0]/255.)
65+
66+
@property
67+
def green(self):
68+
"""Green value as float between 0 and 1."""
69+
return "%.3f" % (hex_to_rgb(self.hex_color)[1]/255.)
70+
71+
@property
72+
def blue(self):
73+
"""Blue value as float between 0 and 1."""
74+
return "%.3f" % (hex_to_rgb(self.hex_color)[2]/255.)
75+
6176
def lighten(self, percent):
6277
"""Lighten color by percent"""
6378
percent = float(re.sub(r'[\D\.]', '', str(percent)))

0 commit comments

Comments
 (0)