Windows cmd with color

Команда 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 .

Introducing the Windows Console Colortool

August 11th, 2017

Last week we announced the exciting news that Windows Console has a new default color scheme, and also promised you that we would release a tool to make it easier to change the console to your desired scheme. The Windows Console team is proud to present the ‘Colortool‘ which you can use to apply the new default color scheme, and several alternate pre-defined color schemes or even schemes of your own!

Get the Tool

You can find the tool inside of this Github repository. It’s an open source project provided under the MIT license so feel free to clone and fork it!

How to Use the Tool

After building colortool, to install it, copy colortool.exe along with the schemes folder to a local directory. Ensure that colortool .exe and the schemes folder are in the same folder! For easy use from a command line place colortool in a location that’s included in your PATH.

Changing the properties of a Window

Open up Command prompt and run:

  • colortool [ scheme name in schemes/ e.g: campbell]
  • Right click on the window title to access the ‘Properties’ dialogue box
  • Once the properties dialogue box opens press OK (which saves the color change)
Читайте также:  Софт для windows sp3

A pplying a color scheme to your defaults

Open up Command prompt and run:

  • colortool -d [scheme name in schemes/]
  • Your current window will not be affected but your defaults now correspond to that theme

Applying a color scheme to both the Window and defaults

Calling ‘ colortool -b [scheme name in schemes/]’ will change both the Window’s current theme and the defaults.

For more information on the tool please read the README inside of the Github page.

Note: the new default color scheme of the Windows Console has been titled campbell, and the legacy scheme is titled cmd-legacy inside of the schemes folder.

Included Schemes

The colortool will work with any .itermcolors scheme. We have also included some useful themes inside of the schemes folder for the tool. This tool makes it easier for users to change their color scheme based on their accessibility needs, and we are excited to promote that by adding a color scheme called deuteranopia targeted towards users who have trouble distinguishing red and green. Here’s a description of each:

  • campbell : The new default color scheme for Windows Console
  • campbell-legacy : The first iteration of the campbell scheme
  • cmd-legacy : The legacy defaults of the Windows Console
  • OneHalfDark : A dark vim-airline theme by Son A. Pham
  • OneHalfLight : A light vim-airline theme by Son A. Pham
  • solarized_dark : The dark version of a popular color scheme by Ethan Schoonover
  • solarized_light : The light version of a popular color scheme by Ethan Schoonover
  • deuteranopia : A color scheme targeted towards making red and green clearer to users with red green colorblindness, and deuteranopia.

For example, here is solarized_dark:

We hope you have fun customizing the Windows Console color scheme to look just how you like it!

Команда 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. Например, мы уже устанавливали красный цвет текста на белом фоне. Вписав подобное значение в реестре, можно установить эту настройку по умолчанию.

Читайте также:  Oracle database 11g ��� linux

Установить одинаковые цвета текста и фона при помощи команды color нельзя. Подобная команда (например, color 55 ) возвратит значение кода ошибки ERRORLEVEL равное 1. Но вот через реестр Windows подобную глупость совершить можно.

Лиловый текст на лиловом фоне в командной строке.

К счастью, и возвратить всё на свои места в случае ошибки не составит труда. Напоминаю, что параметр ScreenColors по умолчанию принимает значение 0x00000007. Это белый текст на чёрном фоне.

Use ColorTool to change Command Prompt color scheme & download more color schemes

Microsoft came up with the bundle of new features with its Windows 10 Fall Creators Update. Along with several improvements seen in its latest version of Windows, it also paved the way for the easy customization of the Windows Console or Command Prompt. In its latest update, Microsoft created a new color scheme for the Windows Console to give a contemporary look. In this post, we will see how to how to change Windows Console color scheme in Windows 10 using Microsoft’s ColorTool & download more color schemes for CMD from Github.

Change Windows Console color scheme

While the design and layout play a key role in improving the legibility of text, the default color values were changed for the legible-ness in the latest high contract monitors. While this feature is seen only if you are running a clean installation of Windows 10, you can still get the new color scheme in your existing Windows system by simply downloading the official tool released by Microsoft. This tool allows for easy customization of your Command Prompt window. The following steps will guide you to install the new color schemes and customize the command prompt with the new color scheme.

Microsoft’s ColorTool

Download the open source tool by Microsoft called Color Tool from GitHub repository and extract the contents of the colortool .zip file to a directory on your system.

Type Command Prompt in the Start menu and right-click on the result. Run CMD as administrator.

Type the following command to navigate to the folder containing color tool executable files and tap Enter:

Type the following command to change the current windows color scheme and press Enter to change the color scheme of Windows console:

The scheme-name colors are available in the “Schemes folder” inside “colortool” folder. In the above command, the scheme-name can be the name of the color scheme you choose.

Campbell.ini, campbell-legacy.ini, cmd-legacy.ini, deuternopia.itermcolors, OneHalfDark.itermcolors, OneHalfLight.itermcolors, solarized_dark.itermcolors and solarized_light.itermcolors are the eight color schemes available in the current release.

Right-click on the Command Prompt’s title bar and select Properties to open up the Properties window.

In the Properties window, click on OK button to apply the changes.

Restart the command prompt to see the results.

Modify default Color scheme of CMD

If you wish to change the command prompt’s default color scheme, type the following command and continue with the last three steps detailed above.

Run the following command to change both default color scheme and current window color scheme. Press Enter and once again follow the last three steps detailed above:

Once done with all the steps above you now have the modern Windows Console with the new color scheme. If at any time you wish to get back to your default color setting, you can do so by simply applying Campbell scheme or use the command cmd-campbell scheme to go back to the default color.

Download color schemes for Command Prompt from GitHub

What if you aren’t happy with the only few color schemes packed in the colortool? We have a solution if you wish to experiment with many other colors. There is an open project in GitHub repository called iTerm2 color schemes which are recommended by Microsoft. It offers more than 100 color schemes.

Читайте также:  Отозвать сообщение outlook mac os

Follow the process outlined below if you want to experiment with these color schemes for your Command Prompt

Go to GitHub repository and download iTerm2-Color-Schemes and extract all the files from iTerm2-Color-Schemes.zip.

Open the schemes folder and copy all the files inside a folder. Next, inside the colortool folder, open the schemes folder and paste the files into the Scheme folder under ColorTool

Now you will be able to apply colors available from these ample of new color schemes.

Upon deciding the color for your Command Prompt, simply follow the steps above to change the color schemes of Command Prompt.

Date: December 9, 2017 Tags: CMD, Customize

Как изменить цвет командной строки в Windows 10

Появилась возможность использовать командную строку в новых цветовых вариантах и в данном руководстве будет рассказано, как выбрать цвет по своему вкусу.

Среди многих функциональных возможностей и различных улучшений в обновлении Windows 10 Fall Creators Update впервые за 20 лет Microsoft внесла изменения в цвета окна командной строки.

Разработчики изменили цветовые варианты по умолчанию, чтобы улучшить читабельность текста на современных мониторах с высоким контрактом. Также есть возможность самому изменить цвет консоли.

Единственная проблема в том, что для доступа к новым цветам нужно работать с чистой установкой Windows 10. Если вы обновлялись с предыдущих вариантов системы, для сохранения настроек применяется прежний цвет. Чтобы решить эту проблему, Microsoft выпустила инструмент для установки нового цветового варианта.

Как изменить цветовую схему командной строки

  1. 1. Скачайте Microsoft Color Tool с GitHub (нажмите по ссылке colortool.zip).
  2. 2. Распакуйте содержимое архива.
  3. 3. Нажмите меню «Пуск».
  4. 4. Введите поисковый запрос «Командная строка», нажмите правой кнопкой мыши и выберите команду «Запуск от имени администратора».
  5. 5. Наберите следующую команду и нажмите ввод. Эта команда откроет папку, которая содержит исполняемый файл Color Tool:
    cd c:\\path\\to\\colortool
    Подставьте путь до этой папки на вашем компьютере.
  6. 6. Наберите следующую команду для изменения цвета командной строки и нажмите ввод:
    colortool -b scheme-name

Вместо scheme-name поставьте название нужного цвета. Названия цветов можно увидеть в папке schemes внутри папки colortool. В текущем релизе доступно 8 цветовых вариантов:

campbell.ini
campbell-legacy.ini
cmd-legacy.ini
deuternopia.itermcolors
OneHalfDark.itermcolors
OneHalfLight.itermcolors
solarized_dark.itermcolors
solarized_light.itermcolors

Переключатель -b можно не ставить, но тогда выбранный вариант станет системным по умолчанию. В противном случае вы видите новые цвета только при запуске консоли Windows через меню «Пуск».

7. Нажмите на окно командной строки правой кнопкой мыши и выберите «Свойства».

8. Здесь не нужно менять никаких настроек, просто нажмите OK для применения изменений.

После завершения всех шагов перезагрузите командную строку и можете пользоваться ей с новыми цветами.
В любой момент вы можете вернуться к цветам по умолчанию.

Как получить ещё больше цветовых вариантов командной строки

Можно добавить дополнительные цвета при помощи файлов .itermcolors из интернета.

Одним из рекомендуемых Microsoft является файл iTerm2 Color Schemes. Это открытый проект на портале GitHub, который предлагает больше 150 цветовых схем для работы с командной строкой. Для использования этих схем следуйте следующей инструкции.

  1. 1. Скачайте iTerm2-Color-Schemes с GitHub.
  2. 2. Распакуйте содержимое архива iTerm2-Color-Schemes.zip.
  3. 3. Откройте папку schemes внутри.
  4. 4. Выделите всё содержимое папки (Ctrl + A) и скопируйте (Ctrl + C).

5. Откройте папку schemes внутри папки colortool и вставьте файлы (Ctrl + V).

После этого используйте описанные выше шаги для установки нового цветового варианта.

Оцените статью