Skip to content

Instantly share code, notes, and snippets.

@kamito
Created November 18, 2010 09:43
Show Gist options
  • Save kamito/704813 to your computer and use it in GitHub Desktop.
Save kamito/704813 to your computer and use it in GitHub Desktop.
BLACK => "\033[30m",
RED => "\033[31m",
GREEN => "\033[32m",
YELLOW => "\033[33m",
BLUE => "\033[34m",
PURPLE => "\033[35m",
CYAN => "\033[36m",
WHITE => "\033[37m",
# background color
BLACKB => "\033[40m",
REDB => "\033[41m",
GREENB => "\033[42m",
YELLOWB => "\033[43m",
BLUEB => "\033[44m",
PURPLEB => "\033[45m",
CYANB => "\033[46m",
WHITEB => "\033[47m",
# bold
B => "\033[1m",
BOFF => "\033[22m",
# italics
I => "\033[3m",
IOFF => "\033[23m",
# underline
U => "\033[4m",
UOFF => "\033[24m",
# invert
R => "\033[7m",
ROFF => "\033[27m",
# reset
RESET => "\033[0m",
@NERO-113
Copy link

RED    => "\033[31m",
GREEN  => "\033[32m",
YELLOW => "\033[33m",
BLUE   => "\033[34m",
PURPLE => "\033[35m",
CYAN   => "\033[36m",
WHITE  => "\033[37m",

# background color
BLACKB  => "\033[40m",
REDB    => "\033[41m",
GREENB  => "\033[42m",
YELLOWB => "\033[43m",
BLUEB   => "\033[44m",
PURPLEB => "\033[45m",
CYANB   => "\033[46m",
WHITEB  => "\033[47m",

# bold
B    => "\033[1m",
BOFF => "\033[22m",

# italics
I => "\033[3m",
IOFF => "\033[23m",

# underline
U => "\033[4m",
UOFF => "\033[24m",

# invert
R => "\033[7m",
ROFF => "\033[27m",

# reset
RESET  => "\033[0m",

@diethyltoluamide
Copy link

diethyltoluamide commented Sep 16, 2024

**this doesnt contain background, whoops

python dict

# res means reset
color = {
    "black"         : "\033[30m",
    "blue"          : "\033[34m",
    "bold"          : "\033[1m",
    "bold_res"      : "\033[22m",
    "cyan"          : "\033[36m",
    "green"         : "\033[32m",
    "italics"       : "\033[3m",
    "italics_res"   : "\033[23m",
    "purple"        : "\033[35m",
    "red"           : "\033[31m",
    "res"           : "\033[0m",
    "underline"     : "\033[4m",
    "underline_res" : "\033[24m",
    "white"         : "\033[37m",
    "yellow"        : "\033[33m"
}

javascript object

// res means reset
const color = {
    black          : "\033[30m",
    blue           : "\033[34m",
    bold           : "\033[1m",
    bold_res       : "\033[22m",
    cyan           : "\033[36m",
    green          : "\033[32m",
    italics        : "\033[3m",
    italics_res    : "\033[23m",
    purple         : "\033[35m",
    red            : "\033[31m",
    res            : "\033[0m",
    underline      : "\033[4m",
    underline_res  : "\033[24m",
    white          : "\033[37m",
    yellow         : "\033[33m"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment