Skip to main content

Posts

Showing posts with the label Graphics

Graphics in C: Using Colors in Text Mode

Graphics in C/C++: Using Colors in Text Mode In Advance Learning Tutorial, today we will learn about the colors in C / C + +. So far, you have used only two colors in your program Black and White, Black color in Background and White color foreground, i.e. to print the character. By default, all compilers use these two colors. But if you want to print any character on your screen from the color of your choice, then you can do it with the help of the functions described below. Keep in mind that the functions described below will only run on Text Mode. Using the colors, you can make your program more attractive in C /C++. Total 15 colors have been defined in C++. To use any color, you can use the name of that color or the corresponding value of that color. This value is already defined in the compiler. All the 15 colors and their values are given in the table below. Values of Colors 1. BLACK 0 2. BLUE 1 3. GREEN 2 4. CYAN 3 5. RED 4 6...