This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ANSI Colors in a C program under Linux...


Hi folks,

I recently noticed that the command line 'linuxconf' program has
text-based colors in its interface...  How would it be possible for me
to utilize these colors in my own C, or C++, program?  I remember doing
this with ANSI colors back when I used to run my own PCBoard from
DOS...  I was also experienced in using the QuickBASIC color statement
to print ANSI colors on SCREEN 0 (text mode)...  Whenever I ask
questions about color and graphics in "comp.lang.c" they send me
elsewhere and say that it is compiler specific...???  I do not agree
with this!!!  I think that a C program can be written with ANSI escape
characters in order to colorize a screen, and I believe that this would
be included in the ANSI Standard of the C language...  It isn't graphics
functions, it just uses the ANSI escape sequences to print...  

I don't know, I may very well be wrong, but if I'm not, could someone
please help me figure this out...  If it is possible to present ANSI
colors in a C program (and still complie to the ANSI C Standard) then
could someone show me a "Hello World" kind of program that has a blue
background with yellow writing (much like the 'linuxconf' console
program)...  Thanks a bunch for reading my ramblings...*s*

Later,
-- 
Trevor Penney, 
A+, Network+ Certified
----------------------
"That's alright, I still got my guitar"... 
-James Marshall Hendrix (11/27/1942-09/18/1970)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]