Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

Summary

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

↑ Back to the top


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 (< and >) 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:
<body bgcolor="#hex value" text="#hex value>
				
To specify the color of specific text, use the COLOR attribute of the FONT tag:
<font color="#hex value">
				
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:
<body bgcolor="#0000FF" text="#FFFFFF">
<p>White text on Blue background.</p>
<p><font color="#000000">Black text on Blue background.</font></p>
</body>
				

↑ Back to the top


References

For more information about using colors in HTML pages created in FrontPage, click the following article number to view the article in the Microsoft Knowledge Base:
295546 Names and hex values for the 16 common colors used in HTML
For more information about HTML syntax, visit the following World Wide Web Consortium (W3C) web site:

↑ Back to the top


Keywords: KB304335, kbinfo

↑ Back to the top

Article Info
Article ID : 304335
Revision : 5
Created on : 10/23/2007
Published on : 10/23/2007
Exists online : False
Views : 311