fill hex string with left zeroes
This commit is contained in:
parent
1c3005f47c
commit
fab739ae9b
2
funcs.py
2
funcs.py
|
@ -64,7 +64,7 @@ def color_mult(e: str, amount: float):
|
||||||
|
|
||||||
hex_result = hex(int(result_val))[2:]
|
hex_result = hex(int(result_val))[2:]
|
||||||
|
|
||||||
return str(hex_result)
|
return hex_result.zfill(2)
|
||||||
|
|
||||||
prefix = "#" * e.startswith("#")
|
prefix = "#" * e.startswith("#")
|
||||||
return prefix + "".join(map(segment, split_hex(e)))
|
return prefix + "".join(map(segment, split_hex(e)))
|
||||||
|
|
Reference in New Issue