export: Added rgba support. Closes #352

This commit is contained in:
Dylan Araps 2019-01-04 21:56:49 +02:00
parent 30af3d0d5c
commit 1e416a18a8

View File

@ -29,6 +29,12 @@ class Color:
"""Convert a hex color to xrdb rgba."""
return hex_to_xrgba(self.hex_color)
@property
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)
@property
def alpha(self):
"""Add URxvt alpha value to color."""