color
嚯嚯 发表于 2020-06-29 15:23浏览次数:
该color命令允许运行MS-DOS或Windows命令行用户更改背景或文本的默认颜色。
The color command allows users running MS-DOS or the Windows command line to change the default color of the background or text.
目录:
1 color 运行系统环境
2 color 语法
3 color 示例
color 运行系统环境
Windows xp
Windows vista
Windows 2000
Windows 7
Windows 8
Windows 10
color 语法
Sets the default console foreground and background colors.
COLOR [attr]
颜色属性由两个十六进制数字指定-第一个对应于背景;第二个对应于背景。第二个前景。每个数字可以是以下任何值。
0 = 黑色
|
8 = 灰色
|
1 = 蓝色
|
9 = 淡蓝色
|
2 = 绿色
|
A = 淡绿色
|
3 = 浅绿色
|
B = 淡浅绿色
|
4 = 红色
|
C = 淡红色
|
5 = 紫色
|
D = 淡紫色
|
6 = 黄色
|
E = 淡黄色
|
7 = 白色
|
F = 亮白色
|
如果未提供任何参数,则此命令将颜色恢复为启动cmd.exe时的颜色。该值或者来自当前的控制台窗口,/ T命令行开关,或者来自“ DefaultColor”注册表值。
如果尝试使用前景色和背景色相同的颜色执行COLOR命令,则COLOR命令会将ERRORLEVEL设置为1。
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 below 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.
color 示例
Color 0A
创建带有浅亮绿色文本的黑色背景,类似于许多FTP,telnet和旧的BBS控制台屏幕。
Color 0A
Creates a black background with light bright green text, similar to many of the FTP, telnet, and old BBS console screens.