I'm writing a function that will take an 3 ints 1 char* 1 bool
It takes an int that stands for background color,
One that stands for text color,
And one for special features(bold, underline, etc.)
The char* is an array that is to be displayed this way...
The bool is to make a box surrounding the words 1 if you want box 0 if not
Everything works pretty well except the fact that
I don't know how to use multiple ASCI codes
Btw everything I learned about them I got from here
1 2 3 4 5 6
|
#define RED "\033[7;32m"
#define GREEN "\033[0;33m"
//later in program
printf(RED);//works
printf(GREEN);//doesn't display???
printf("Hi\n!");
|
Now I know I could do
|
printf( RED GREEN "Hi!\n");
|
The problem with that is I am not just writing this in main()
I'm putting it in another function...
1 2 3 4
|
if (background==red && text==green && special==none && box==none)
{
printf (RED GREEN "%s", words);
}
|
This isn't so bad but I have to do it for all 8 colors
For background & text plus the special(bold, underline, strike, blink, etc)
So all in all it would take up a lot more time and space
About 300 lines id guess
I know there is a way to do this but how?