Skip to content
Color Confusions
Profile icon
PattanAhmed

Hi,
See, This is my commands on a color string in Python.
As you all can see that I wrote print(Pink + "Hello") in First Line and print("Ok") in the second line.

But when I run this commands my second line string is also turning Pink even though I didn't mention Pink there...
Why is it happening?
Is there a solution to it?

Thanks,
Waiting for Replies!

You are viewing a single comment. View All
Answered by Bookie0 [earned 5 cycles]
View Answer
Profile icon
TheForArkLD

This is pink. in repl some color is not true color.

Profile icon
PattanAhmed

@TheForArkLD
THEN WHAT ARE THE TRUE COLORS IN PYTHON?

Profile icon
TheForArkLD

@PattanAhmed
No true color. give up .-.

Profile icon
PattanAhmed

@TheForArkLD
It can be possible dude...
There will be of course some way!
I will find it out

Profile icon
TheForArkLD

@PattanAhmed
Lol no, but really no way to display true color by this.

Profile icon
TheForArkLD

@PattanAhmed
Good idea. use it
( replace n to 0 ~ 255 )
Text : \x1b[38;5;nm
Background : \x1b[48;5;nm

Profile icon
TheForArkLD

@PattanAhmed
but you need find pink from 0 ~ 255.

Profile icon
PattanAhmed

@TheForArkLD
Can you please send me your code,
I will try it.

Profile icon
TheForArkLD

@PattanAhmed
try it in js

for(var i=0;i < 256;i++){ console.log("\u001b[48;5;" + i + "m" + i + "\u001b[m"); }
Profile icon
PattanAhmed

@TheForArkLD
I need Python Code not JavaScript.
Thanks!

Profile icon
TheForArkLD

@PattanAhmed
ye. run this js for know code.

Profile icon
PattanAhmed

@TheForArkLD
Hmmm...
Good Joke :)