Pergunta

I was trying to find if it is possible to colour console output in windows system. I found that Console - Ansi but i cant find any information about coloring output in windows prompt.

I woudl appreciate information about my problem.

Foi útil?

Solução

It's been a while, but I think the correct usage is:

setRGB [SetColor Foreground Yellow, SetColor Background Red]

to set yellow writing on a red background. Also setTitle followed by a String sets the console window title.

Outras dicas

It worked for me like this:

set the foregroundcolor to Yellow

    setSGR [SetColor Foreground Vivid Yellow]

and then reset it to normal after putting your String on the screen

    putStrLn "ayellowstring"
    setSGR [Reset]

You need

    import System.Console.ANSI

to do this

PowerShell and the console setting will be the solution.Console only have 16 colors,but you can config any 16 colors you like(i.e. you can make gray scale console)

this link explain how to

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top