exposes the alpha value as a decimal as well

This commit is contained in:
Martin Patz 2020-03-23 01:01:32 +01:00
parent ee50fb3ab3
commit 52d1f5e7d4

View file

@ -36,13 +36,17 @@ class Color:
def rgba(self):
"""Convert a hex color to rgba."""
return "rgba(%s,%s,%s,%s)" % (*hex_to_rgb(self.hex_color),
int(self.alpha_num) / 100)
self.alpha_dec)
@property
def alpha(self):
"""Add URxvt alpha value to color."""
return "[%s]%s" % (self.alpha_num, self.hex_color)
@property
def alpha_dec(self):
return int(self.alpha_num) / 100
@property
def octal(self):
"""Export color in octal"""