Ok, but ( curiosity killed the cat ) what is white ?
PoSH> [enum]::GetNames([System.ConsoleColor]) |% {$_;"{0:x}" -f
([drawing.Color]$_).ToArgb()}
Black
ff000000
DarkBlue
ff00008b
DarkGreen
ff006400
DarkCyan
ff008b8b
DarkRed
ff8b0000
DarkMagenta
ff8b008b
DarkYellow
Cannot convert value "DarkYellow" to type "System.Drawing.Color". Error:
"DarkYellow is not a valid value for Int32."
At line:1 char:77
+ [enum]::GetNames([System.ConsoleColor]) |% {$_;"{0:x}" -f
([drawing.Color]$_) <<<< .ToArgb()}
Gray
ff808080
DarkGray
ffa9a9a9
Blue
ff0000ff
Green
ff008000
Cyan
ff00ffff
Red
ffff0000
Magenta
ffff00ff
Yellow
ffffff00
White
ffffffff
For DarkYellow your on your own , but .. (more than you did want to know )
PoSH> [enum]::GetNames([drawing.KnownColor]) |% {$_;"{0:x}" -f
([drawing.Color]$_).ToArgb()}
but got to pack, plane leaves soon ;-)
PoSH> [datetime]'Friday, March 09, 2007 01:15 PM' - (get-date) |% {"$_"}
16:05:16.2980055
enjoy,
Greetings /\/\o\/\/
"/\/\o\/\/ [MVP]" <mow001@hotmail.NoSpam> wrote in message
news:222FDFD3-E735-4B99-9A53-E31E67D4F0B3@microsoft.com...
> PoSH> $c = [drawing.color]'red'
> PoSH> "{0:x}" -f $c.ToArgb()
> ffff0000
>
> ;-)
>
> gr /\/\o\/\/
>
> "RichS" <RichS@discussions.microsoft.com> wrote in message
> news:6E3D0DAE-E819-4CE1-B645-F10B91E5D447@microsoft.com...
>> just out of curiosity what does red translate to in hex
>> --
>> Richard Siddaway
>> Please note that all scripts are supplied "as is" and with no warranty
>> Blog: http://richardsiddaway.spaces.live.com/
>> PowerShell User Group: http://www.get-psuguk.org.uk
>>
>>
>> "Marco Shaw" wrote:
>>
>>> PowerShell/.NET/COM have anything that can take a 'human readable' color
>>> like "red" and convert it to hex, and vice-versa?
>>>
>>> Marco
>>>
>>>
>>>
>