mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-05-28 13:47:47 +02:00
Merge 10e716ca907366ac7198e08c4a7340688ef5258e into 236aa48e741ff8d65c4c3826db2813bf2ee6f352
This commit is contained in:
commit
f7139e6a10
@ -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."""
|
||||
@ -48,6 +54,11 @@ class Color:
|
||||
"""Export the alpha value as a decimal number in [0, 1]."""
|
||||
return int(self.alpha_num) / 100
|
||||
|
||||
@property
|
||||
def alpha_hex(self):
|
||||
"""Export the alpha value as a hexdecimal number in [00, FF]."""
|
||||
return "%02X" % (int(int(self.alpha_num) * 255 / 100))
|
||||
|
||||
@property
|
||||
def decimal(self):
|
||||
"""Export color in decimal."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user