mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-02-08 06:19:41 +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):
|
def rgba(self):
|
||||||
"""Convert a hex color to rgba."""
|
"""Convert a hex color to rgba."""
|
||||||
return "rgba(%s,%s,%s,%s)" % (*hex_to_rgb(self.hex_color),
|
return "rgba(%s,%s,%s,%s)" % (*hex_to_rgb(self.hex_color),
|
||||||
int(self.alpha_num) / 100)
|
self.alpha_dec)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def alpha(self):
|
def alpha(self):
|
||||||
"""Add URxvt alpha value to color."""
|
"""Add URxvt alpha value to color."""
|
||||||
return "[%s]%s" % (self.alpha_num, self.hex_color)
|
return "[%s]%s" % (self.alpha_num, self.hex_color)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def alpha_dec(self):
|
||||||
|
return int(self.alpha_num) / 100
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def octal(self):
|
def octal(self):
|
||||||
"""Export color in octal"""
|
"""Export color in octal"""
|
||||||
|
Loading…
Reference in New Issue
Block a user