As cores do console do cmd são definidas por meio de entradas colortáveis |
(24 bit, cores de 8 bits RGB invertido 0xBBGGRR),
que pode ser visto no registro:
> reg query "hkcu\console"
HKEY_CURRENT_USER\console
ColorTable00 REG_DWORD 0x0
ColorTable01 REG_DWORD 0x800000
ColorTable02 REG_DWORD 0x8000
ColorTable03 REG_DWORD 0x808000
ColorTable04 REG_DWORD 0x80
ColorTable05 REG_DWORD 0x800080
ColorTable06 REG_DWORD 0x8080
ColorTable07 REG_DWORD 0xc0c0c0
ColorTable08 REG_DWORD 0x808080
ColorTable09 REG_DWORD 0xff0000
ColorTable10 REG_DWORD 0xff00
ColorTable11 REG_DWORD 0xffff00
ColorTable12 REG_DWORD 0xff
ColorTable13 REG_DWORD 0xff00ff
ColorTable14 REG_DWORD 0xffff
ColorTable15 REG_DWORD 0xffffff
A nomenclatura cmd color /?
se desvia do PowerShell
Color /? Dec Hex PowerShell
0 = Black 0 0 Black
1 = Blue 1 1 DarkBlue
2 = Green 2 2 DarkGreen
3 = Aqua 3 3 DarkCyan
4 = Red 4 4 DarkRed
5 = Purple 5 5 DarkMagenta
6 = Yellow 6 6 DarkYellow
7 = White 7 7 Gray
8 = Gray 8 8 DarkGray
9 = Light Blue 9 9 Blue
A = Light Green 10 a Green
B = Light Aqua 11 b Cyan
C = Light Red 12 c Red
D = Light Purple 13 d Magenta
E = Light Yellow 14 e Yellow
F = Bright White 15 f White
E também o PowerShell tem duas entradas diferentes do ColorTable:
ColorTable05 REG_DWORD 0x562401
ColorTable06 REG_DWORD 0xf0edee
O último sendo o DarkYellow
do PowerShell comparado com o Yellow = 0x8080
do CMD explica a diferença em suas imagens.