Example #1
0
def convertColor(color: Optional[str]) -> str:
    ignoreColors = ["z", "zzz", "grt", "oth", "utc", "dne", "gmt"]
    if color is not None and color not in ignoreColors:
        if color.startswith("#"):
            return color
        elif len(color) == 6:
            return "#" + color
        else:
            return {
                "grn": "green",
                "amb": "#FFBF00",
                "hzl": "#8E7618",
                "gry": "bright_black",
                "blu": "blue",
                "brn": "#654321",
                "lzr": "#00ff00",
                "xry": "#0083D9"
            }[color]
    else:
        return Color.default().get_truecolor().rgb
Example #2
0
def test_default() -> None:
    assert Color.default() == Color("default", ColorType.DEFAULT, None, None)