Skip to content
← Back to Community
how do we change the color of the text that input
Profile icon
mathimo

abc

Voters
Profile icon
SweetAvni14
Profile icon
GurpreetSingh69
Profile icon
RicardoMartin27
Profile icon
BikramjeetDhugg
Profile icon
lazybluebird
Profile icon
neginlol
Profile icon
HarunBijedic
Profile icon
Felixclsn
Profile icon
QuartzRidg
Profile icon
lucasnili
Comments
hotnewtop
Profile icon
NikiArezehgar

ummm but how can you do the same thing but in javascript?

Profile icon
ash15khng

You can use ANSI escape sequences. More info here.
You could also use termcolor for Python (and I think a few other languages)

Profile icon
Geocube101

What Language?

Profile icon
mathimo

@Geocube101 python3

Profile icon
Geocube101

@mathimo you can use termcolor as specified by
ash15khng.

Profile icon
mathimo

@Geocube101 yes but can you show me an example

Profile icon
Geocube101

@mathimo

from termcolor import colored user_input = input(colored(string, color)) #Where string is the prompt for the input command and color #is a valid termcolor color

Valid termcolor colors can be found here