Hello friends! 👋
Did you know you can customize the look of Command Prompt (CMD) without installing any third-party software? The built-in COLOR command allows you to change the text color and background color of the Command Prompt window in just a few seconds.
Whether you're writing batch scripts, improving readability, or simply giving CMD a fresh look, the COLOR command is an easy way to personalize your terminal.
In this guide, you'll learn how the COLOR command works, understand color codes, and explore practical examples that every beginner should know.
💡 My Experience
When I first started learning batch scripting, I used the default black-and-white Command Prompt. Later, I began using different color combinations to distinguish scripts, highlight warnings, and make command output easier to read.
Using color thoughtfully can improve readability, especially when working with long command outputs or demonstrations.
What Is the COLOR Command?
The COLOR command is a built-in Windows Command Prompt command that changes the appearance of the CMD window by setting:
Background color
Text (foreground) color
The change affects the current Command Prompt session unless you configure CMD properties separately.
Command Syntax
COLOR [background][text]
Example:
COLOR 0A
In this example:
0 = Black background
A = Light Green text
Understanding Color Codes
| Code | Color |
|---|---|
| 0 | Black |
| 1 | Blue |
| 2 | Green |
| 3 | Aqua |
| 4 | Red |
| 5 | Purple |
| 6 | Yellow |
| 7 | White / Light Gray |
| 8 | Gray |
| 9 | Light Blue |
| A | Light Green |
| B | Light Aqua |
| C | Light Red |
| D | Light Purple |
| E | Light Yellow |
| F | Bright White |
Before You Start
Before using the COLOR command:
Open Command Prompt.
Ensure you are entering valid color codes.
Remember that the background and text colors cannot be the same.
Example 1: Green Text on Black Background
COLOR 0A
Result:
Black background
Light Green text
A popular choice for a classic terminal appearance.
Example 2: Bright White Text on Blue Background
COLOR 1F
Result:
Blue background
Bright White text
💡 My Recommendation
For everyday use, choose high-contrast color combinations such as 0A (Black/Light Green) or 0F (Black/White). They are generally easier to read than combinations with similar brightness.
Example 3: Yellow Text on Black Background
COLOR 0E
Result:
Black background
Light Yellow text
Useful for highlighting important information.
Example 4: Red Text on Black Background
COLOR 0C
Result:
Black background
Light Red text
Often used for warnings or error messages.
Restore the Default Colors
To restore the default Command Prompt colors for the current session:
COLOR
If the default colors have been changed in the Command Prompt properties, the command restores those configured defaults for the session.
⚠️ Note
The COLOR command changes the appearance of the current Command Prompt session. It does not permanently change the default color settings for all future CMD windows unless you modify the Command Prompt properties separately.
Invalid Color Combinations
The background and text colors cannot be identical.
Example:
COLOR 00
Because both values are the same, the command will not apply that color combination.
Using COLOR in Batch Files
The COLOR command is commonly used in batch scripts to improve readability.
Example:
@echo off
color 0A
echo Welcome to My Batch Script!
pause
This displays green text on a black background for the script's output.
Popular COLOR Combinations
| Command | Appearance |
|---|---|
COLOR 0A | Black background, Light Green text |
COLOR 0F | Black background, Bright White text |
COLOR 1F | Blue background, Bright White text |
COLOR 0E | Black background, Light Yellow text |
COLOR 0C | Black background, Light Red text |
COLOR F0 | Bright White background, Black text |
💡 Pro Tip
If you're creating batch files, use colors consistently—for example, green for success messages, yellow for warnings, and red for errors. Consistent color usage makes scripts easier to read and understand.
Image Suggestions
Include screenshots of:
Default Command Prompt.
COLOR 0A.COLOR 1F.COLOR 0E.COLOR 0C.COLOR command syntax.
Batch file using the COLOR command.
Quick Summary Table
| Command | Purpose |
|---|---|
COLOR | Restore the session's default colors |
COLOR 0A | Green text on black background |
COLOR 0F | White text on black background |
COLOR 1F | White text on blue background |
COLOR 0C | Red text on black background |
COLOR 0E | Yellow text on black background |
Common Beginner Mistakes
Avoid these mistakes:
Using the same color code for both the background and text.
Expecting the command to permanently change CMD settings.
Choosing low-contrast color combinations that are difficult to read.
Typing invalid hexadecimal color codes.
Forgetting that the command affects only the current session.
Confusing the letter O with the number 0.
Using colors that reduce accessibility for long reading sessions.
Interesting Facts
The COLOR command has been available in Windows Command Prompt for many years.
Color codes are represented using hexadecimal characters from 0–9 and A–F.
Many developers use color-coded batch scripts to improve readability.
The Command Prompt supports both text and background color customization.
High-contrast color combinations can make terminal output easier to read during demonstrations.
Best Practices
Use high-contrast color combinations.
Keep colors consistent across your batch scripts.
Restore default colors when appropriate.
Test scripts on different systems if readability is important.
Use color to enhance clarity, not to distract from the output.
Combine colors with clear text messages for better usability.
Conclusion
The COLOR command is a simple yet effective way to customize the appearance of Windows Command Prompt. Whether you're learning CMD, writing batch scripts, or making terminal output easier to read, understanding color codes can improve both the look and usability of your command-line experience.
Experiment with different combinations, but remember to prioritize readability by choosing colors that provide good contrast.
Frequently Asked Questions (FAQs)
1. What does the COLOR command do in CMD?
It changes the text and background colors of the current Command Prompt session.
2. How do I change CMD text to green?
Use:
COLOR 0A
3. Can I permanently change the Command Prompt color?
Yes. You can configure default colors through the Command Prompt window's Properties settings. The COLOR command itself changes the current session unless those defaults are modified separately.
4. Why doesn't COLOR 00 work?
Because the background and text colors cannot be the same.
5. Can I use the COLOR command in batch files?
Yes. It is commonly used to improve the appearance and readability of batch script output.
6. Does the COLOR command work on all versions of Windows?
It is supported in many versions of Windows that include the traditional Command Prompt, though appearance and behavior may vary slightly.
7. Which COLOR combination is most popular?
COLOR 0A (black background with light green text) is one of the most widely used combinations because it offers good contrast and a classic terminal appearance.
