add support for hex_argb

This commit is contained in:
Chris Hoage 2021-01-08 16:31:18 -08:00
parent 4997a49eb7
commit f91237f5ab
No known key found for this signature in database
GPG Key ID: FA6B2BD22EAEE8FF

View File

@ -38,6 +38,12 @@ class Color:
return "rgba(%s,%s,%s,%s)" % (*hex_to_rgb(self.hex_color),
self.alpha_dec)
@property
def hex_argb(self):
"""Convert an alpha hex color to argb hex."""
return "#%02X%s" % (int(int(self.alpha_num) * 255 / 100),
self.hex_color[1:])
@property
def alpha(self):
"""Add URxvt alpha value to color."""