Microsoft KB Archive/304335

= Hex values for the 216 color safe palette used in HTML documents in FrontPage =

Article ID: 304335

Article Last Modified on 10/23/2007

-

APPLIES TO


 * Microsoft FrontPage 2002 Standard Edition
 * Microsoft FrontPage 2000 Standard Edition
 * Microsoft FrontPage 98 Standard Edition

-



This article was previously published under Q304335



SUMMARY
This article lists the hexadecimal values for the 216 colors that make up the Safe Palette of colors for use in HTML documents.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

Note You may receive an error message if you copy the examples directly from this article and paste them in FrontPage. The angle brackets may appear as escaped HTML code (&lt; and &gt;). To work around this behavior, paste the script in a blank Notepad document, and then copy it from Notepad before you paste it in FrontPage.

Several HTML tags allow you to specify colors in HTML documents. For example, to set the background color and the default color of text, use the BGCOLOR and TEXT attributes of the BODY tag:  To specify the color of specific text, use the COLOR attribute of the FONT tag:  The hex values are a combination of six hexadecimal digits that are read left to right in pairs, representing the color levels for Red, Green, and Blue (RGB) respectively. These values allow for 24-bit color resolution, or a total of 16,777,216 possible colors. However, not every computer is capable of displaying all of these colors.

Since most computers are capable of displaying at least 256 colors, a Safe Palette of colors was created. This palette is constructed by incrementing each color value by 51 decimal, or 33 hexadecimal. (For example, the values 00, 33, 66, 99, CC, and FF.) This allows for a palette of 216 colors, which stays inside the range of possible colors for a computer that supports 256 colors.

The following table lists the hex values for the 216 colors that make up the Safe Palette of colors for web browsers:

To use a specific color, you simply need to specify the color value. The following example, uses the hexadecimal color values, to set the background color to blue, the default color for text to white, and the color of of text in a specific range of pages to black:  White text on Blue background. Black text on Blue background.

