ConsoleColors的实际RGB值是多少? [英] What are the actual RGB values of the ConsoleColors?
问题描述
我将彩色控制台输出转换为HTML。目前,我首先将控制台颜色翻译为相同名称的颜色(和深黄色手动,因为它不存在那里)。
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).
但是,我发现一些颜色和ConsoleColor的名称看起来完全不同,例如CC-Green只有#008000而不是#00FF00(我确认是实际的RGB值)。
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).
我找不到所有ConsoleColors的实际RGB值的列表,我可以在映射表中使用它。这样的列表是否存在?
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?
推荐答案
我最终只是检查所有的值。值是非常不同的,我不知道为什么人们推荐转换'按名称'。
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
这篇关于ConsoleColors的实际RGB值是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!