mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-07 08:34:01 +01:00
exposes the alpha value as a decimal as well
This commit is contained in:
parent
ee50fb3ab3
commit
52d1f5e7d4
@ -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"""
|
||||
|
Loading…
Reference in New Issue
Block a user