color
- help color
Output:
コンソールの既定の前景色と背景色を設定します。
COLOR [属性]
属性 コンソール出力の色属性を指定します。
色属性は、2 桁の 16 進数で指定します。
1 桁目は背景に、2 桁目は前景に対応します。
各桁には、次のいずれかの値を指定することができます:
0 = 黒 8 = 灰色
1 = 青 9 = 明るい青
2 = 緑 A = 明るい緑
3 = 水色 B = 明るい水色
4 = 赤 C = 明るい赤
5 = 紫 D = 明るい紫
6 = 黄色 E = 明るい黄色
7 = 白 F = 輝く白
引数を指定しないでこのコマンドを実行すると、CMD.EXE が起動されたときの
色を復元します。
この値は、現在のコンソール ウィンドウ、/T コマンド ライン スイッチ、
またはレジストリの DefaultColor 値から取得されます。
前景と背景に同じ色を指定して COLOR コマンドを実行しようとすると、
COLOR コマンドは、ERRORLEVEL を 1 に
設定します。
例: "COLOR fc" は、輝く白の上に明るい赤を表示します。
Sets the default console foreground and background colors.
COLOR [attr]
attr Specifies color attribute of console output
Color attributes are specified by TWO hex digits -- the first
corresponds to the background; the second the foreground. Each digit
can be any of the following values:
0 = Black 8 = Gray
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, this command restores the color to what it was
when CMD.EXE started. This value either comes from the current console
window, the /T command line switch or from the DefaultColor registry
value.
The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute
the COLOR command with a foreground and background color that are the
same.
Example: "COLOR fc" produces light red on bright white
Return Code: 1