Add decimal output support

This commit is contained in:
Seth Holland 2020-05-25 00:09:35 -05:00
parent ad9b05ba93
commit f057c08d1e

View File

@ -48,6 +48,16 @@ class Color:
"""Export the alpha value as a decimal number in [0, 1]."""
return int(self.alpha_num) / 100
@property
def decimal(self):
"""Export color in decimal."""
return "%s%s" % ("#", int(self.hex_color[1:], 16))
@property
def decimal_strip(self):
"""Strip '#' from decimal color."""
return int(self.hex_color[1:], 16)
@property
def octal(self):
"""Export color in octal."""