def parse_colormode(colormode: int, blink: bool,
                    bright: bool, bold: bool) -> int:
    """Parse colormode setters into colormode.

    Returns the colormode in int. Blink and Bright will override colormode.
    Bold overrides colormode if :py:`colormode == 8`.

    Args:
        colormode: Colormode for colors. Any in :py:`[8, 16, 256]`.
        blink: Toggle blink/bright/256 bit mode.
        bright: Toggle blink/bright/256 bit mode.
        bold: Toggle bold/16-bit mode.

    Returns:
        Either 8, 16 or 256 (as integer) corresponding to the colormode.
    """
    if blink or bright or colormode == 256:
        colormode = 256
        return colormode
    elif bold or colormode == 16:
        colormode = 16
        return colormode
    else:
        return colormode