+ 1

How to color it in C++

I made a calculator with C++ but how do I color it, design it I mean there is css for web sites but in C++ how can I color it

25th Jul 2021, 11:13 AM
Codelearner
4 Antworten
+ 1
there are some ways to do it. this approach is better than system(color f2). you can use any combination of red green and blue on the foreground (text) and the background. don't forget to include <window.h>. it only works in windows console. example: HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY); std::cout << "Hey there!" << std::endl; source: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682088(v=vs.85).aspx#_win32_character_attributes
25th Jul 2021, 11:41 AM
Rellot's screwdriver
Rellot's screwdriver - avatar
- 1
You can use SDL or SFML
25th Jul 2021, 7:29 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
- 1
If you are on Linux then you can use escape sequences. Search for it on Google. It is very easy.
26th Jul 2021, 4:57 AM
🌀 Shail Murtaza شعیل مرتضیٰ
🌀 Shail Murtaza شعیل مرتضیٰ - avatar