The COLOR command is one of the simplest and most fun commands in Windows CMD (Command Prompt). It allows you to change the background color and text color of the Command Prompt window instantly.
Whether you're learning CMD or creating batch scripts, understanding the COLOR command can make your console look more professional and easier to read.
This beginner-friendly guide explains everything you need to know.
📌 What is the COLOR Command?
The COLOR command changes the default foreground (text) and background colors of the Command Prompt window.
Basic syntax:
COLOR [attr]
Here, attr stands for Color Attribute.
🎨 Understanding Color Attributes
The COLOR command uses two hexadecimal characters:
COLOR fc
First Character = Background Color
The first character controls the background color.
Second Character = Text Color
The second character controls the text (foreground) color.
🧩 Example
Command:
COLOR fc
Meaning:
| Character | Meaning |
|---|---|
| f | Bright White Background |
| c | Light Red Text |
Result:
👉 Light Red Text on White Background
🎯 Common Color Codes
| Code | Color |
|---|---|
| 0 | Black |
| 1 | Blue |
| 2 | Green |
| 3 | Aqua |
| 4 | Red |
| 5 | Purple |
| 6 | Yellow |
| 7 | White |
| 8 | Gray |
| 9 | Light Blue |
| A | Light Green |
| B | Light Aqua |
| C | Light Red |
| D | Light Purple |
| E | Light Yellow |
| F | Bright White |
🚀 Popular COLOR Command Examples
Green Hacker Style
COLOR 0A
✔ Black Background
✔ Light Green Text
Red Text on Black
COLOR 0C
✔ Black Background
✔ Light Red Text
Yellow Text on Blue
COLOR 1E
✔ Blue Background
✔ Light Yellow Text
White Text on Black (Default Style)
COLOR 07
✔ Black Background
✔ White Text
🔄 Restore Default CMD Colors
To return CMD to its default colors:
COLOR 07
This is the standard Windows Command Prompt appearance.
💻 Using COLOR in Batch Files
You can also use COLOR inside BAT scripts.
Example:
@echo off
color 0A
echo Welcome to CodeSardar!
pause
This creates a green-text console effect.
⚠️ Important Rule
The background and text colors cannot be the same.
Example:
COLOR 00
or
COLOR FF
These combinations make text invisible and may not work properly.
🎨 Best Color Combinations
| Command | Appearance |
|---|---|
| COLOR 0A | Green Hacker Style |
| COLOR 0C | Red Alert Style |
| COLOR 1F | White on Blue |
| COLOR E0 | Black on Yellow |
| COLOR F1 | Blue Text on White |
📝 Final Words
The COLOR command is a simple but powerful CMD feature that allows you to customize the appearance of Command Prompt instantly. Whether you're learning Windows commands or creating batch scripts, using colors can make your CMD window look cleaner, more professional, and more fun.
Experiment with different color combinations and create your own console style.
For more Windows CMD tricks and tutorials, visit CodeSardar.
❓ Frequently Asked Questions
Q1. What does COLOR 0A mean?
It means Black Background with Light Green Text.
Q2. Can I use COLOR in BAT files?
Yes, the COLOR command works perfectly in batch scripts.
Q3. How do I reset CMD colors?
Use:
COLOR 07
to restore the default appearance.
