mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-02-22 13:10:49 +01:00
add octal output support
This commit is contained in:
parent
9dede6dd61
commit
1e8165e71b
@ -37,6 +37,16 @@ class Color:
|
|||||||
"""Strip '#' from color."""
|
"""Strip '#' from color."""
|
||||||
return self.hex_color[1:]
|
return self.hex_color[1:]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def octal(self):
|
||||||
|
"""Export color in octal"""
|
||||||
|
return '#' + 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:]
|
||||||
|
|
||||||
|
|
||||||
def read_file(input_file):
|
def read_file(input_file):
|
||||||
"""Read data from a file and trim newlines."""
|
"""Read data from a file and trim newlines."""
|
||||||
|
Loading…
Reference in New Issue
Block a user