Ejemplo 1: colores ansi
Black e[0;30m
Blue e[0;34m
Green e[0;32m
Cyan e[0;36m
Red e[0;31m
Purple e[0;35m
Brown e[0;33m
Gray e[0;37m
Dark Gray e[1;30m
Light Blue e[1;34m
Light Green e[1;32m
Light Cyan e[1;36m
Light Red e[1;31m
Light Purple e[1;35m
Yellow e[1;33m
White e[1;37m
Ejemplo 2: colección de colores de secuencias de escape ansi de Python
class colors:
reset = " 33[0m"
# Black
fgBlack = " 33[30m"
fgBrightBlack = " 33[30;1m"
bgBlack = " 33[40m"
bgBrightBlack = " 33[40;1m"
# Red
fgRed = " 33[31m"
fgBrightRed = " 33[31;1m"
bgRed = " 33[41m"
bgBrightRed = " 33[41;1m"
# Green
fgGreen = " 33[32m"
fgBrightGreen = " 33[32;1m"
bgGreen = " 33[42m"
bgBrightGreen = " 33[42;1m"
# Yellow
fgYellow = " 33[33m"
fgBrightYellow = " 33[33;1m"
bgYellow = " 33[43m"
bgBrightYellow = " 33[43;1m"
# Blue
fgBlue = " 33[34m"
fgBrightBlue = " 33[34;1m"
bgBlue = " 33[44m"
bgBrightBlue = " 33[44;1m"
# Magenta
fgMagenta = " 33[35m"
fgBrightMagenta = " 33[35;1m"
bgMagenta = " 33[45m"
bgBrightMagenta = " 33[45;1m"
# Cyan
fgCyan = " 33[36m"
fgBrightCyan = " 33[36;1m"
bgCyan = " 33[46m"
bgBrightCyan = " 33[46;1m"
# White
fgWhite = " 33[37m"
fgBrightWhite = " 33[37;1m"
bgWhite = " 33[47m"
bgBrightWhite = " 33[47;1m"
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)