Hi,
I have the RGB & HSL values of some colors. I want to use to use the RGB or HSL to color the text on my screen.
And I need to change the background to white.
Please help me. I am doing this to associate some letters with colors and some other stuff that would be too complicated to explain.
Thx.
By the way the code below is the closest I got to what i want but I don;t have all the colors I want.
Code:#define BLACK 0 #define BLUE 1 #define GREEN 2 #define CYAN 3 #define RED 4 #define MAGENTA 5 #define BROWN 6 #define LIGHTGREY 7 #define DARKGREY 8 #define LIGHTBLUE 9 #define LIGHTGREEN 10 #define LIGHTCYAN 11 #define LIGHTRED 12 #define LIGHTMAGENTA 13 #define YELLOW 14 #define WHITE 15 #define BLINK 128 #include <windows.h> #include <iostream> using namespace std; int main() { srand((unsigned) time(NULL)); cout << "Hello World!" << endl; cout << "Welcome to C++ Programming" << endl; int k; do{ //SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 2); //replace the 0 with a number for the color you want // 0xFF0000 TextBackground(1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3 ); cin >> k; cout <<"\n"; int n = rand() % 26; char c = (char)(n+65); n = rand() % 26; char d = (char)(n+65); cout << c << d << "\n"; }while(k == 0); return 0; }



LinkBack URL
About LinkBacks


