Wiki: Fix Color Issues in Wiki Articles

Wiki: Fix Color Issues in Wiki Articles

Many Wiki articles use colors. Unfortunately, the way colors are often specified in HTML, using RGB (Red, Green, Blue) values, is no longer supported in the TechNet Wiki. Until this situation is corrected, a workaround is to specify colors by color name in the HTML. This article helps implement this workaround. The issue has been discussed in this forum thread:

TechNet Wiki Discussion  > Table Formatting Lost After Edit

In HTML colors can be specified as RGB values, three integers representing the amounts of red, green, and blue in the color. The integers range from 0 to 255. For example, the color red would be specified as rgb(255, 0, 0). Unfortunately, when a Wiki article using RGB values is saved, most of the colors are often lost. The workaround is to replace the RGB values with color names. For example, replace this HTML:

<span style="color: rgb(255,0,0);">Example</span>

with this:

<span style="color: red;">Example</span>

Alternatively, colors can be specified with the "#" character followed by three hexadecimal bytes, each byte ranging from 00 to FF. There must be two characters for each byte. In this format, red is specified as #FF0000. This format is also no longer supported and must be replaced by a standard color name.

The RGB system can specify over 3 million colors, but only 140 color names are recognized by the HTML and CSS color specification. This makes it difficult to select the best color name. The table below documents suggested color names to use in place of some RGB values found in TechNet Wiki articles.

A script was developed to select the color name closest to each RGB value. The script considers the three RGB integers (or hexadecimal bytes) as coordinates in three dimensional space. For each standard color name, the script calculates the distance between it and the RGB value. The color with the smallest distance is selected and documented in the table below. This was found to be much better than estimating by eye. The script has been posted in the TechNet Script Gallery here:

Gallery > Scripting Techniques > Fix Color Issues in TechNet Wiki Articles

The first column of the table is the RGB value. The second column is the equivalent hexadecimal format for the color, such as #FF0000 for red. The third column is the color name that corresponds to these values. The last column shows the resulting color as rendered in your browser.

RGB Values Hex Value HTML name Color
rgb(0, 0, 0) #000000 Black  
rgb(0, 0, 128) #000080 Navy
rgb(0, 0, 139) #00008B DarkBlue  
rgb(0, 0, 205) #0000CD MediumBlue  
rgb(0, 0, 255) #0000FF Blue  
rgb(0, 100, 0) #006400 DarkGreen  
rgb(0, 128, 0) #008000 Green  
rgb(0, 128, 128) #008080 Teal  
rgb(0, 139, 139) #008B8B DarkCyan  
rgb(0, 191, 255) #00BFFF DeepSkyBlue  
rgb(0, 206, 209) #00CED1 DarkTurquoise  
rgb(0, 250, 154) #00FA9A MediumSpringGreen  
rgb(0, 255, 0) #00FF00 Lime  
rgb(0, 255, 127) #00FF7F SpringGreen  
rgb(0, 255, 255) #00FFFF Aqua  
rgb(0, 255, 255) #00FFFF Cyan  
rgb(25, 25, 112) #191970 MidnightBlue  
rgb(30, 144, 255) #1E90FF DodgerBlue  
rgb(32, 178, 170) #20B2AA LightSeaGreen  
rgb(34, 139, 34) #228B22 ForestGreen  
rgb(46, 139, 87) #2E8B57 SeaGreen  
rgb(47, 79, 79) #2F4F4F DarkSlateGray  
rgb(47, 79, 79) #2F4F4F DarkSlateGrey  
rgb(50, 205, 50) #32CD32 LimeGreen  
rgb(60, 179, 113) #3CB371 MediumSeaGreen  
rgb(64, 224, 208) #40E0D0 Turquoise  
rgb(65, 105, 225) #4169E1 RoyalBlue  
rgb(70, 130, 180) #4682B4 SteelBlue  
rgb(72, 61, 139) #483D8B DarkSlateBlue  
rgb(72, 209, 204) #48D1CC MediumTurquoise  
rgb(75, 0, 130) #4B0082 Indigo  
rgb(85, 107, 47) #556B2F DarkOliveGreen  
rgb(95, 158, 160) #5F9EA0 CadetBlue  
rgb(100, 149, 237) #6495ED CornflowerBlue  
rgb(102, 205, 170) #66CDAA MediumAquamarine  
rgb(105, 105, 105) #696969 DimGray  
rgb(105, 105, 105) #696969 DimGrey  
rgb(106, 90, 205) #6A5ACD SlateBlue  
rgb(107, 142, 35) #6B8E23 OliveDrab  
rgb(112, 128, 144) #708090 SlateGray  
rgb(112, 128, 144) #708090 SlateGrey
rgb(119, 136, 153) #778899 LightSlateGray  
rgb(119, 136, 153) #778899 LightSlateGrey  
rgb(123, 104, 238) #7B68EE MediumSlateBlue  
rgb(124, 252, 0) #7CFC00 LawnGreen  
rgb(127, 255, 0) #7FFF00 Chartreuse  
rgb(127, 255, 212) #7FFFD4 Aquamarine  
rgb(128, 0, 0) #800000 Maroon  
rgb(128, 0, 128) #800080 Purple  
rgb(128, 128, 0) #808000 Olive  
rgb(128, 128, 128) #808080 Gray  
rgb(128, 128, 128) #808080 Grey  
rgb(135, 206, 235) #87CEEB SkyBlue
rgb(135, 206, 250) #87CEFA LightSkyBlue  
rgb(138, 43, 226) #8A2BE2 BlueViolet  
rgb(139, 0, 0) #8B0000 DarkRed  
rgb(139, 0, 139) #8B008B DarkMagenta  
rgb(139, 69, 19) #8B4513 SaddleBrown  
rgb(143, 188, 143) #8FBC8F DarkSeaGreen  
rgb(144, 238, 144) #90EE90 LightGreen  
rgb(147, 112, 219) #9370DB MediumPurple  
rgb(148, 0, 211) #9400D3 DarkViolet  
rgb(152, 251, 152) #98FB98 PaleGreen  
rgb(153, 50, 204) #9932CC DarkOrchid  
rgb(154, 205, 50) #9ACD32 YellowGreen  
rgb(160, 82, 45) #A0522D Sienna  
rgb(165, 42, 42) #A52A2A Brown  
rgb(169, 169, 169) #A9A9A9 DarkGray  
rgb(169, 169, 169) #A9A9A9 DarkGrey  
rgb(173, 216, 230) #ADD8E6 LightBlue  
rgb(173, 255, 47) #ADFF2F GreenYellow  
rgb(175, 238, 238) #AFEEEE PaleTurquoise  
rgb(176, 196, 222) #B0C4DE LightSteelBlue  
rgb(176, 224, 230) #B0E0E6 PowderBlue  
rgb(178, 34, 34) #B22222 FireBrick  
rgb(184, 134, 11) #B8860B DarkGoldenrod  
rgb(186, 85, 211) #BA55D3 MediumOrchid  
rgb(188, 143, 143) #BC8F8F RosyBrown  
rgb(189, 183, 107) #BDB76B DarkKhaki  
rgb(192, 192, 192) #C0C0C0 Silver  
rgb(199, 21, 133) #C71585 MediumVioletRed  
rgb(205, 92, 92) #CD5C5C IndianRed  
rgb(205, 133, 63) #CD853F Peru  
rgb(210, 105, 30) #D2691E Chocolate  
rgb(210, 180, 140) #D2B48C Tan  
rgb(211, 211, 211) #D3D3D3 LightGray  
rgb(211, 211, 211) #D3D3D3 LightGrey  
rgb(216, 191, 216) #D8BFD8 Thistle  
rgb(218, 112, 214) #DA70D6 Orchid  
rgb(218, 165, 32) #DAA520 Goldenrod  
rgb(219, 112, 147) #DB7093 PaleVioletRed  
rgb(220, 20, 60) #DC143C Crimson  
rgb(220, 220, 220) #DCDCDC Gainsboro  
rgb(221, 160, 221) #DDA0DD Plum  
rgb(222, 184, 135) #DEB887 BurlyWood  
rgb(224, 255, 255) #E0FFFF LightCyan  
rgb(230, 230, 250) #E6E6FA Lavender  
rgb(233, 150, 122) #E9967A DarkSalmon  
rgb(238, 130, 238) #EE82EE Violet  
rgb(238, 232, 170) #EEE8AA PaleGoldenrod  
rgb(240, 128, 128) #F08080 LightCoral  
rgb(240, 230, 140) #F0E68C Khaki  
rgb(240, 248, 255) #F0F8FF AliceBlue  
rgb(240, 255, 240) #F0FFF0 Honeydew  
rgb(240, 255, 255) #F0FFFF Azure  
rgb(244, 164, 96) #F4A460 SandyBrown  
rgb(245, 222, 179) #F5DEB3 Wheat  
rgb(245, 245, 220) #F5F5DC Beige  
rgb(245, 245, 245) #F5F5F5 WhiteSmoke  
rgb(245, 255, 250) #F5FFFA MintCream  
rgb(248, 248, 255) #F8F8FF GhostWhite  
rgb(250, 128, 114) #FA8072 Salmon  
rgb(250, 235, 215) #FAEBD7 AntiqueWhite  
rgb(250, 240, 230) #FAF0E6 Linen  
rgb(250, 250, 210) #FAFAD2 LightGoldenrodYellow  
rgb(253, 245, 230) #FDF5E6 OldLace  
rgb(255, 0, 0) #FF0000 Red  
rgb(255, 0, 255) #FF00FF Fuchsia  
rgb(255, 0, 255) #FF00FF Magenta  
rgb(255, 20, 147) #FF1493 DeepPink  
rgb(255, 69, 0) #FF4500 OrangeRed  
rgb(255, 99, 71) #FF6347 Tomato  
rgb(255, 105, 180) #FF69B4 HotPink  
rgb(255, 127, 80) #FF7F50 Coral  
rgb(255, 140, 0) #FF8C00 DarkOrange  
rgb(255, 160, 122) #FFA07A LightSalmon  
rgb(255, 165, 0) #FFA500 Orange  
rgb(255, 182, 193) #FFB6C1 LightPink  
rgb(255, 192, 203) #FFC0CB Pink  
rgb(255, 215, 0) #FFD700 Gold  
rgb(255, 218, 185) #FFDAB9 PeachPuff  
rgb(255, 222, 173) #FFDEAD NavajoWhite  
rgb(255, 228, 181) #FFE4B5 Moccasin  
rgb(255, 228, 196) #FFE4C4 Bisque  
rgb(255, 228, 225) #FFE4E1 MistyRose  
rgb(255, 235, 205) #FFEBCD BlanchedAlmond  
rgb(255, 239, 213) #FFEFD5 PapayaWhip  
rgb(255, 240, 245) #FFF0F5 LavenderBlush  
rgb(255, 245, 238) #FFF5EE Seashell  
rgb(255, 248, 220) #FFF8DC Cornsilk  
rgb(255, 250, 205) #FFFACD LemonChiffon  
rgb(255, 250, 240) #FFFAF0 FloralWhite  
rgb(255, 250, 250) #FFFAFA Snow  
rgb(255, 255, 0) #FFFF00 Yellow  
rgb(255, 255, 224) #FFFFE0 LightYellow  
rgb(255, 255, 240) #FFFFF0 Ivory  
rgb(255, 255, 255) #FFFFFF White  

External Links

See Also

Short URL

You can reach this article with a short URL via: http://aka.ms/fixrgb

Sort by: Published Date | Most Recent | Most Useful
Comments
Page 1 of 1 (5 items)