def str_to_color(s):
    """Convert hex string to color value."""
    if len(s) == 3:
        s = ''.join(c + c for c in s)

    values = bytes.fromhex(s)

    # Scale from [0-255] to [0-1]
    return [c / 255.0 for c in values]