DrEvil
FCRI Associate!
- Reaction score
- 111
I've been working on a text based game in c++ (Console)
And well.... All the text is white.
I've read up ways of being able to change the output text colour through:
'SetConsoleTextAttribute(hConsole, k);'
where hConsole is the handle of the window and k is a hex number (0-255,0xFF) (the first char would be the text background and the second is the text colour)
the hex value has a maximum of 16 colours.(for background and text colour)
I am wondering if there is a way to set a custom colour of text through a UInt32? Where the RGB can be modified on its own?
e.g. SetTextColour(0x9564fa); Would give me a nice purple...
and also a function for the background colour?
I'm just curious as the 16 colours (including black ) are just not the colours I find useful
And well.... All the text is white.
I've read up ways of being able to change the output text colour through:
'SetConsoleTextAttribute(hConsole, k);'
where hConsole is the handle of the window and k is a hex number (0-255,0xFF) (the first char would be the text background and the second is the text colour)
the hex value has a maximum of 16 colours.(for background and text colour)
I am wondering if there is a way to set a custom colour of text through a UInt32? Where the RGB can be modified on its own?
e.g. SetTextColour(0x9564fa); Would give me a nice purple...
and also a function for the background colour?
I'm just curious as the 16 colours (including black ) are just not the colours I find useful