SetConsoleTextAttribute(.....,BACKGROUND_BLUE);
can i replace BACKGROUND_BLUE with hex color, such as RGB color? If yes, how to do it?
Thank
SetConsoleTextAttribute(.....,BACKGROUND_BLUE);
can i replace BACKGROUND_BLUE with hex color, such as RGB color? If yes, how to do it?
Thank
I dont think so.......the 3 colours allowed are defined as so
Theese are then OR'ed....if you want a more diverse coulour system.....so for a full GUI application.#define BACKGROUND_BLUE 0x0010 // background color contains blue.
#define BACKGROUND_GREEN 0x0020 // background color contains green.
#define BACKGROUND_RED 0x0040 // background color contains red.
SetConsoleTextAttribute (GetStdHandle(STD_OUTPUT_HANDLE), 2);
You just change the number to your liking. And to get brighter colors do this:
SetConsoleTextAttribute (GetStdHandle(STD_OUTPUT_HANDLE), 2 | FOREGROUND_INTENSITY);
next time go here
Yes but that doesnt give the colour diversity that a normal RGB will offer.........Originally posted by TechWins
SetConsoleTextAttribute (GetStdHandle(STD_OUTPUT_HANDLE), 2);
You just change the number to your liking. And to get brighter colors do this:
SetConsoleTextAttribute (GetStdHandle(STD_OUTPUT_HANDLE), 2 | FOREGROUND_INTENSITY);
next time go here
Sometimes you have to shed the mantles of the console to get what you need......
I agree, but for realitive simplicity what I suggested is a good solution.Yes but that doesnt give the colour diversity that a normal RGB will offer.........
Sometimes you have to shed the mantles of the console to get what you need......