@classmethod
def ansi16(cls, offset, r, g, b, brighten):
    """Convert RGB to ANSI 16 color"""
    r = int(round(r / 255.0))
    g = int(round(g / 255.0)) << 1
    b = int(round(b / 255.0)) << 2
    code = (90 if brighten else 30) + (r | g | b)
    return int(code) + offset - cls.fg_offset
