mafu
mafu

Reputation: 32640

What are the actual RGB values of the ConsoleColors?

I'm converting colored console output to HTML. Currently, I'm first translating ConsoleColors to the Color of the same name (and dark yellow manually as it is not present there).

However, I found that some Color and ConsoleColor of the same name look quite differently, for instance CC-Green is only #008000 instead of #00FF00 (which I confirmed is the actual RGB value).

I could not find a list of the actual RGB values of all ConsoleColors, which I could use in a mapping table. Does such a list exist?

Upvotes: 1

Views: 1607

Answers (1)

mafu
mafu

Reputation: 32640

I ended up just checking all values myself. The values are very different, I have no idea why people recommend converting 'by name'.

Name         Actual      Drawing.Color of same name
Black        #000000     #000000
DarkBlue     #000080     #00008B
DarkGreen    #008000     #006400
DarkCyan     #008080     #008B8B
DarkRed      #800000     #8B0000
DarkMagenta  #800080     #8B008B
DarkYellow   #808000     #000000
Gray         #C0C0C0     #808080
DarkGray     #808080     #A9A9A9
Blue         #0000FF     #0000FF
Green        #00FF00     #008000
Cyan         #00FFFF     #00FFFF
Red          #FF0000     #FF0000
Magenta      #FF00FF     #FF00FF
Yellow       #FFFF00     #FFFF00
White        #FFFFFF     #FFFFFF

CC RGB test

Upvotes: 5

Related Questions