- Команда COLOR — установить цвет символов и фона консоли Windows
- Command line CMD background change color, but how, with example?
- Also during the command input you can change the CMD background color by command and the text, here an example!
- 1.) Change the background color and foreground color in the CMD!
- 2.) Change the text and background color of the CMD!
- 3.) What should I consider when changing the CMD color?
- Команда COLOR: меняем цвет текста и фона в командной строке Windows
- COLOR
- New default Color schemes
- 24 bit colors
- Errorlevels
- How to Change Text and Background Color in CMD
- Steps to change text and background color in cmd:
Команда COLOR — установить цвет символов и фона консоли Windows
Команда COLOR задает цвет символов и цвет фона в окне консоли .
Формат командной строки:
COLOR [цвет фона][цвет текста]
Цвет задается шестнадцатеричной цифрой, Старший бит определяет яркость, а последующие биты — цвет :
Бит 0 — яркость
Бит 1 — красный ( R )
Бит 2 — зеленый ( G )
Бит 3 — синий ( B )
По умолчанию, используются белые буквы на черном фоне — цвет фона = 0 , цвет символов =7. Значения битов задают комбинацию цветов, так например, для желтого цвета используется установка битов 1 и 2 ( Красный и Зеленый). Команда для установки яркого синего цвета ( 9 ) на желтом фоне ( 6 ) : color 69
То же, но на ярком желтом фоне:
color F0 — черные символы на ярком белом фоне, color 0F — наоборот, белые яркие символы на черном фоне. .
Каждая цифра может иметь следующие значения:
Если в команде COLOR задана только одна цифра, то она определяет цвет символов на черном фоне (значение цвета фона воспринимается как 0 ):
COLOR 1 — синие буквы на черном фоне, как в команде COLOR 01
Если аргумент не указан, команда восстанавливает исходный набор цветов, каким он был на момент запуска CMD.EXE. Этот набор определяется из значения ключа /T, если он был задан при запуске интерпретатора CMD.EXE, или из значения параметров реестра, определяющих пользовательские настройки для интерпретатора команд:
HKEY_LOCAL_MACHINE\ SOFTWARE\ Microsoft \Command Processor\ DefaultColor — для всех пользователей.
HKEY_CURRENT_USER\ Software\ Microsoft\ Command Processor\ DefaultColor — для текущего пользователя. Значения параметров из раздела пользователя более приоритетны, по сравнению с параметрами раздела HKEY_LOCAL_MACHINE
Если параметр DefaultColor имеет значение по умолчанию ( REG_DWORD 0x00000000 ), то цветовой набор определяется значением параметра
HKEY_CURRENT_USER\ Console\ ScreenColors .
Команда COLOR возвращает значение кода ошибки ERRORLEVEL равный 1 при попытке вызова этой команды с совпадающими значениями цвета текста и цвета фона, например — COLOR 00 .
Command line CMD background change color, but how, with example?
Also during the command input you can change the CMD background color by command and the text, here an example!
The color values can be indicated by two consecutive hexadecimal digits!
1.) Change the background color and foreground color in the CMD!
The first hexadecimal digit defines the background of the prompt,
the second hexadecimal digit defines the foreground, or text color.
You can see the color options by command COLOR /?
Here is an example blue background yellow text! (. see Image-1)
Tip: The letters can be written small and capitalized.
(Image-1) Command Prompt change background and text! |
2.) Change the text and background color of the CMD!
Enter the color command without parameters to reset the color to default. (. see Image-2 Point 1)
(Image-2) Reset background and colors changes! |
3.) What should I consider when changing the CMD color?
Attempting to use the same foreground and background color will ignore this command.
Команда COLOR: меняем цвет текста и фона в командной строке Windows
По умолчанию командная строка Windows располагает чёрным фоном с текстом белого цвета, который располагается на нём. Если такие оформление вам надоело, то, как ни странно, это можно изменить без особых усилий.
Конечно, можно изменить данные настройки через графический интерфейс системы (правой кнопкой мыши по рамке окна командной строки → Свойства → Цвета), но сегодня мы рассмотрим полезную команду COLOR, которая позволяет делать то же самое без дополнительных щелчков мышью.
Изменение цвета текста и фона в командной строке Windows.
Синтаксис команды color очень прост:
Цвета задаются шестнадцатеричными цифрами. Первая цифра отвечает за цвет фона, вторая за цвет текста. Можно использовать следующие цифры:
0 — черный;
1 — синий;
2 — зеленый;
3 — голубой;
4 — красный;
5 — лиловый;
6 — желтый;
7 — белый;
8 — серый;
9 — светло-синий;
A — светло-зеленый;
B — светло-голубой;
C — светло-красный;
D — светло-лиловый;
E — светло-желтый;
F — ярко-белый.
Указав сочетания двух цифр, мы можем задать цвет текста и фона. Например, красный на белом:
Если указать в команде одну цифру, то это будет воспринято как указание цвета текста на чёрном фоне. Например, команда
даст нам светло-зеленый текст на чёрном фоне.
Следует учитывать, что данные настройки будут действовать только пока текущее окно командной строки открыто. Но что делать, если мы хотим сохранить их на постоянной основе? В этом нам помогут два параметра реестра: DefaultColor и ScreenColors.
Для начала посмотрим на DefaultColor. Его можно задать как для отдельного пользователя:
так и для всех пользователей:
Значение параметра из раздела пользователя (HKEY_CURRENT_USER) имеют приоритет над значением параметра для всех.
По умолчанию DefaultColor имеет значение 0x00000000. Это значит, что настройки цвета определяются другим параметром:
Для установки настроек достаточно отредактировать DefaultColor или ScreenColors. Например, мы уже устанавливали красный цвет текста на белом фоне. Вписав подобное значение в реестре, можно установить эту настройку по умолчанию.
Установить одинаковые цвета текста и фона при помощи команды color нельзя. Подобная команда (например, color 55 ) возвратит значение кода ошибки ERRORLEVEL равное 1. Но вот через реестр Windows подобную глупость совершить можно.
Лиловый текст на лиловом фоне в командной строке.
К счастью, и возвратить всё на свои места в случае ошибки не составит труда. Напоминаю, что параметр ScreenColors по умолчанию принимает значение 0x00000007. Это белый текст на чёрном фоне.
COLOR
Sets the default console foreground and background colours.
Colour attributes are specified by 2 of the following hex digits. There should be no space between the two color numbers.
Each digit can be any of the following values:
1 = Blue
9 = Light Blue
2 = Green
A = Light Green
3 = Aqua
B = Light Aqua
4 = Red
C = Light Red
5 = Purple
D = Light Purple
6 = Yellow
E = Light Yellow
7 = White
F = Bright White
If no argument is given, COLOR restores the colour to what it was when CMD.EXE started.
Colour values are assigned in the following order:
The DefaultColor registry value.
The CMD /T command line switch
The current colour settings when cmd was launched
The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute the COLOR command with a foreground and background colour that are the same.
The default terminal color is COLOR 07 , white on black
The COLOR command will change the color of all the text in the window. To change the color of individual words/characters/paragraphs ANSI color escapes can be used. These are available in Windows versions greater than 1511.
New default Color schemes
In Windows 10 clean-install versions greater than build 16257 the default colour scheme has been changed to modernize the look of the Windows Console suitable for modern high-contrast LCD displays.
Samples of the new colors can be found on the ANSI color page, you can also display them with ColorTool.exe -c
If using ColorTool, you may want to tinker with the new values: «So up until very recently the console only supported 16 colours at a time. When the PowerShell team decided they wanted a very specific dark blue as the background colour, rather than altering the colour value for dark or light blue, they instead changed dark magenta to blue and used that as the background colour».
24 bit colors
The new W10 Console also adds full 24-bit color support, this is primarily for Linux compatibility so the console properties page and the default Windows color mappings still use just 16 colors, there is no plan to add additional console colors to the Win32 API.
To take advantage of the new colors use ColorTool.exe and install a theme, or use the VT100 sequences described here.
When the VT100 sequences are used with a version of the Windows Console that supports 24-bit colors they will display the desired RGB color, older consoles will choose the nearest appropriate color from the existing 16 color table.
Errorlevels
If the color was successfully changed %ERRORLEVEL% = 0
Background and foreground colors are the same (will fail) = 1
e.g. COLOR 00
COLOR is an internal command.
If Command Extensions are disabled, the COLOR command will not function.
“How much more black could this be?» and the answer is «None. none more black”
CMD — Start a new CMD shell.
EXIT — Set a specific errorlevel.
How-to: Use ANSI colors in the terminal.
PowerShell: Write-Host — Write output to the screen (colour can be set for individual strings).
Colour codes — HTML/CSS.
Aaron Margosis — Change prompt colors for all Admin level prompts.
Paletton — Design colour themes.
Equivalent bash command (Linux): dircolors — Colour setup for ‘ls’
How to Change Text and Background Color in CMD
If you once used Command Prompt to make some operations on your computer, you would know that the original text and background color in it is a black-and-white combination (see the following picture). By the way, do you like the color matching? If your answer is negative, the good news for you is that you are able to change text and background color on cmd. For your information, this text is going to illustrate the practical way with logical steps as well as clear pictures.
Video guide on how to change text and background color in cmd on Windows 8:
Steps to change text and background color in cmd:
Step 2: Get to Command Prompt Properties.
At the top of Command Prompt window, right-click the title bar and select Properties in the list, as exhibited in the following picture.
Step 3: Set text color.
As the Properties window turns up, click Colors, select Screen Text, choose a color from the color list for choice and tap OK to ascertain the text color. For explicit illustration, please refer to the photo below.
Tips: Up till now, the text color in cmd has been successfully changed. Furthermore, if you want to alter text and background color at the same time, you can move to Step 4 before you click OK.
Step 4: Set background color.
In Colors, choose Screen Background, select a color in the color list and tap OK, as shown in the following screenshot.
Soon, the color of text and background is changed to the chosen color.
Besides, you can also change the color of Popup Text and Popup Background in the Command Prompt Properties window to achieve the same goal.
After reading the above content, you are capable of changing the color of text and background in cmd without other people’s help.
Related Articles:
iSunshare is dedicated to providing the best service for Windows, Mac, Android users who are in demand for password recovery and data recovery.