Can someone help to to get to know how many colour codes there are in replit
Hey @AbdullahQayumi welcome to the forums!
What language are you using? If you are using Python you can use ANSI codes.
# ANSI color codes
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
BROWN = "\033[0;33m"
BLUE = "\033[0;34m"
PURPLE = "\033[0;35m"
CYAN = "\033[0;36m"
LIGHT_GRAY = "\033[0;37m"
DARK_GRAY = "\033[1;30m"
LIGHT_RED = "\033[1;31m"
LIGHT_GREEN = "\033[1;32m"
YELLOW = "\033[1;33m"
LIGHT_BLUE = "\033[1;34m"
LIGHT_PURPLE = "\033[1;35m"
LIGHT_CYAN = "\033[1;36m"
LIGHT_WHITE = "\033[1;37m"
BOLD = "\033[1m"
FAINT = "\033[2m"
ITALIC = "\033[3m"
UNDERLINE = "\033[4m"
BLINK = "\033[5m"
NEGATIVE = "\033[7m"
CROSSED = "\033[9m"
END = "\033[0m"
Then you can add them to your text like so:
# The text will be blue
print(BLUE + "Hello World")
5 Likes
Adding on to @SalladShooter here, you could also use something like colorama
, ansicolors
, or even the bcolors
section of my package. You could install any one of these with one of the following:
pip install PACKAGE_NAME
poetry add PACKAGE_NAME
or, you could use Replit’s built-in Packager
.
6 Likes
thank u for the codes
I appreciate it.
2 Likes
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.