5

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.

Jonke
  • 6,525
  • 2
  • 25
  • 40
whd
  • 1,819
  • 1
  • 21
  • 52
  • That package should work just fine on Windows. Can you be more specific about what your problem is? – MathematicalOrchid Jul 05 '12 at 19:04
  • i cant just figure out how does it work and that is additional package isnt there any library to works with coloros in std library ? – whd Jul 05 '12 at 19:31

3 Answers3

5

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.

MathematicalOrchid
  • 61,854
  • 19
  • 123
  • 220
0

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

baloo
  • 21
  • 1
  • 5
-1

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

lee kim
  • 1
  • 2