I do not really know how can solve this exercise but..
you can use dos color command for changing colors you can change backaround screen and lines.
if u change second number u change color of lyircs (charchers)
#include <stdio.h>
#include <windows.h>
int main ( void )
{
HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE );
WORD wOldColorAttrs;
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
/*
* First save the current color information
*/
GetConsoleScreenBufferInfo(h, &csbiInfo);
wOldColorAttrs = csbiInfo.wAttributes;
/*
* Set the new color information
*/
SetConsoleTextAttribute ( h, FOREGROUND_RED | FOREGROUND_INTENSITY );
printf ( "This is a test\n" );
/*
* Restore the original colors
*/
SetConsoleTextAttribute ( h, wOldColorAttrs);
return 0;
}
But I Know how to change color,but don't know how to make this thing the square and insade a example red and background green and lyrics to be a blue :?
// Red on White
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
BACKGROUND_INTENSITY | FOREGROUND_INTENSITY |
BACKGROUND_RED | BACKGROUND_GREEN |
BACKGROUND_BLUE |
FOREGROUND_RED);
If you want red text on a green background
1 2 3 4
// Red on Green
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
BACKGROUND_INTENSITY | FOREGROUND_INTENSITY |
BACKGROUND_GREEN | FOREGROUND_RED);
insade a example red and background green and lyrics to be a blue
I don't know what you mean with this. Could you elaborate?
I'm guessing you want some text to be red on a green background followed by some blue text on the same green background? Correct me if I'm wrong.
To do that:
1 2 3 4 5 6 7 8 9 10 11 12 13
// Red on Green
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
BACKGROUND_INTENSITY | FOREGROUND_INTENSITY |
BACKGROUND_GREEN | FOREGROUND_RED);
printf("Example ");
// Blue on Green
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
BACKGROUND_INTENSITY | FOREGROUND_INTENSITY |
BACKGROUND_GREEN | FOREGROUND_BLUE);
printf("Lyrics");