def example(self) -> str:
        """ Same as str(self), except the color codes are actually used. """
        if self.rgb_mode:
            colorcode = '\033[38;2;{};{};{}m'.format(*self.rgb)
        else:
            colorcode = '\033[38;5;{}m'.format(self.code)
        return '{code}{s}\033[0m'.format(code=colorcode, s=self)
Same as str(self), except the color codes are actually used.