Skip to content

Instantly share code, notes, and snippets.

@feluelle
Created April 22, 2019 19:42
Show Gist options
  • Save feluelle/c2ebf6d6d5d6ce394de0643722e7edc0 to your computer and use it in GitHub Desktop.
Save feluelle/c2ebf6d6d5d6ce394de0643722e7edc0 to your computer and use it in GitHub Desktop.
Enumeration of Colors that are also colored when printed
from enum import Enum
class Color(Enum):
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
BLUE = '\033[34m'
def __repr__(self):
return f'{self.value}{self.name}\033[0m'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment