Jump to content
  • Advertisement
Sign in to follow this  
peb

Colored texts 'n' background?

This topic is 5067 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay im making a simple irc bot in C. Im running slackware 10. Now, i want the backround to be black, and the incoming info (that the server sends) to be blue, and the messeges the bot sends to be red (or something similar) Is that possible? The first thing that came to my mind was ncurses, but is it hard to do that with ncurses? The second thing i thought about was the 'built in' color codes with linux (vt100). printf("\\033[32m I'm green text"); But then i cant do the backround black, right? Anyways, if you could hook me up with those color codes, or maybe a simple ncurses tutorial that learns to to color things, that would be great! thank you Best regards, Max!

Share this post


Link to post
Share on other sites
Advertisement
I'm not 100% sure if this is on the right track, but have you tried using the telnet escapes?
%c[1;37m where %c is characted #27(yeah, decimal)
That one should give you a bright white color, and this one: %c[0;31m should give you a dark-red color. If it works, go between them to figure out the different colors.
And, in telnet atleast, you can set the background color aswell.

Share this post


Link to post
Share on other sites
I've tried using ncurses long ago, and I'd say go with it. It's quite easy to use, and you can change the color on background and text like you want. As Zahlman said, try google for a ncurses tutorial.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!