Background color problem

I'm using asci codes e.g. \033[0;35m
And I want to do
1
2
3
4
5
6
#define RED_BG "\033[7;31m"
#define GREEN_TXT "\033[0;32m"
//later in my program...
printf(RED_BG);
printf(GREEN_TXT);
printf("Hello World!");

The problem is that only one shows up either the background or the foreground
I realize I could do
 
printf(RED_BG GREEN_TXT "Hello World!");

And it would work but I'm doing something where the calling function
Tellls the function what colors and special things (bold,underline)
so it'd take 300 lines when it could only take 50
Last edited on
Topic archived. No new replies allowed.