+ 2

Painting console text

I was needed to write something in colors and found these codes but could not test on computer after a compile ; here in solo play ground it seems it is not working. is there a way to do that ? Console.BackgroundColor = ConsoleColor.Red; Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("Hello World'); Console.ResetColor();

18th Jul 2017, 11:11 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar
5 Answers
+ 5
Code playground bypass standard console object and doesn't provide full functionalities like with access to the real console object... on desktop/laptop browsers it may works, as bypass not even work as expected (at least in FireFox console message are still displayed in real console instead of inside code playground layout... and line number indication are hard to locate because refering to the whole playground content instead of your embeded code :P)
19th Jul 2017, 8:34 AM
visph
visph - avatar
+ 7
must be working. SL can't change colors (I think because of standartized output view: grey, black), but code will run anyway
18th Jul 2017, 11:38 PM
Illusive Man
Illusive Man - avatar
+ 4
You can send feedback to Sololearn for suggesting such things ;) Use 'feedback' main menu option of app' or contact them through media listed here: http://www.sololearn.com/Contact
19th Jul 2017, 10:25 AM
visph
visph - avatar
+ 2
I don't think CodePlayground will allow color change on the Console. I've tried it in Java before and had no luck.
18th Jul 2017, 11:31 PM
Rrestoring faith
Rrestoring faith - avatar
+ 1
from the answers i figure out that we are limited in CPG.it would be nice to have at least color options in console for python/cpp/cs and java
19th Jul 2017, 9:32 AM
Melih Melik Sonmez
Melih Melik Sonmez - avatar