liamcottle___reticulum-mesh.../src/backend/colour_utils.py
2024-12-26 00:37:37 +13:00

10 lines
252 B
Python

class ColourUtils:
@staticmethod
def hex_colour_to_byte_array(hex_colour):
# remove leading "#"
hex_colour = hex_colour.lstrip('#')
# convert the remaining hex string to bytes
return bytes.fromhex(hex_colour)