def HTMLColorToRGB(colorString):
    """
    Convert #RRGGBB to a [R, G, B] list.
    :param: colorString a string in the form: #RRGGBB where RR, GG, BB are hexadecimal.
    The elements of the array rgb are unsigned chars (0..255).
    :return: The red, green and blue components as a list.
    """
    colorString = colorString.strip()
    if colorString[0] == '#':
        colorString = colorString[1:]
    if len(colorString) != 6:
        raise ValueError("Input #%s is not in #RRGGBB format" % colorString)
    r, g, b = colorString[:2], colorString[2:4], colorString[4:]
    r, g, b = [int(n, 16) for n in (r, g, b)]
    return [r, g, b]