Skip to content

Utils

awtrix_light_client.models.utils.convert_color_to_hex

convert_color_to_hex(color)

Helper function to convert a color in hex format

Parameters:

Name Type Description Default
color Color

color to convert

required

Returns:

Type Description
str

color in hex format

Source code in awtrix_light_client/models/utils.py
 4
 5
 6
 7
 8
 9
10
def convert_color_to_hex(color: Color) -> str:
    """Helper function to convert a color in hex format

    :param color: color to convert
    :return: color in hex format
    """
    return color.as_hex(format="long").upper()