How would I go about doing this in ruby..

K

Kyle Pinkman

Quick question, I have asked some other programmers, they were not
sure.. my friend who knows c had said cout.SetColor('color'); although,
ruby is not c, but I take its something simular.. so if anyone, can help
me, this is an example, of what I want to be able to do.

http://img217.imageshack.us/img217/5291/adsfwz0.jpg

thats a link to the image, and basically I wanna control the fonts
color, and the bg color of it..
 
C

Collins, Justin

------_=_NextPart_001_01C6E6A2.38AB5656
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Kyle said:
Quick question, I have asked some other programmers, they were not=20
sure.. my friend who knows c had said cout.SetColor('color'); = although,=20
ruby is not c, but I take its something simular.. so if anyone, can = help=20
me, this is an example, of what I want to be able to do.

http://img217.imageshack.us/img217/5291/adsfwz0.jpg

thats a link to the image, and basically I wanna control the fonts=20
color, and the bg color of it..

This just involves outputting the color codes for the console. You can =
do this by hand, or use one of the libraries available:

http://rubyforge.org/projects/term-ansicolor/
http://rubyforge.org/projects/highline/

Hope that helps.

-Justin

------_=_NextPart_001_01C6E6A2.38AB5656--
 
D

David Roberts

Kyle said:
Quick question, I have asked some other programmers, they were not
sure.. my friend who knows c had said cout.SetColor('color'); although,
ruby is not c, but I take its something simular.. so if anyone, can help
me, this is an example, of what I want to be able to do.

http://img217.imageshack.us/img217/5291/adsfwz0.jpg

thats a link to the image, and basically I wanna control the fonts
color, and the bg color of it..

If you need to implement this for Windows, as that screenshot suggests,
you might get a quick return from win32console -

Z:\>gem list -r win32console

*** REMOTE GEMS ***

win32console (1.0.8)
A library giving the Win32 console ANSI escape sequence support.

deejay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,214
Messages
2,571,112
Members
47,704
Latest member
DavidSuita

Latest Threads

Top