export: Added octal support. Closes #193

This commit is contained in:
Dylan Araps 2018-03-03 16:58:01 +11:00
parent 39e5ab295b
commit dafaa06389

View File

@ -32,6 +32,16 @@ class Color:
"""Add URxvt alpha value to color."""
return "[%s]%s" % (self.alpha_num, self.hex_color)
@property
def octal(self):
"""Export color in octal"""
return "%s%s" % ("#", oct(int(self.hex_color[1:], 16))[2:])
@property
def octal_strip(self):
"""Strip '#' from octal color."""
return oct(int(self.hex_color[1:], 16))[2:]
@property
def strip(self):
"""Strip '#' from color."""