indiWiz.com
SiteSearch:
Jump:

Site Map | WizTools.org | jCraze Blog
Web Developer's Den!
Home : WDD : HTML
This Article...
Print Version
Add Comment
View Comments
HTML
HTML Primer 1
HTML Primer 2
Hyperlinks
Color Guide 1
Color Guide 2
Fonts in HTML
HTML Lists
Table Tutor 1
Table Tutor 2
HTMLfx
HTML Special Characters
HTML Editors
Animation and HTML
XHTML - The Bare Facts
Sections

Commniquè
Sign Guestbook!
Read Guestbook!
MailMe!

Subhash's Guide to Color Coding - I

Color Coding in HTML

Our eyes can perceive millions of millions of colors. But a computer can display only a limited number of colors. The number of colors are basically reduced to 3: Red, Green & Blue -RGB. The value of each of these color can be anything from 0 to 255. Various other colors are achieved by combining these three colors in various degrees. For example, a combination of full red, green & blue creates white (don't ask me how, that is what they taught me at school, & it works in computers!) - thus in RGB mode white is displayed as (255,255,255).

HTML too follows this concept of RGB. But a little differently. The RGB values in decimal should be converted hexadecimal for use in HTML. Take the example of color white. The hexadecimal value of '255' is 'FF'. Thus (255,255,255) is represented:
#FFFFFF
The hash symbol '#' tells the browser that what follows is color code. The first two 'FF' represents the value of Red, the next two 'FF' that of Green, & the last 'FF' that of Blue.

Now how do you convert decimal values to hex values? Use the software developed by me, Subhash's RGB2HEX Convertor.

Web Safe Palette

Every modern video card is capable of displaying a minimum of 256 colors. But the question is which 256? This is determined by the Operating System. Windows displays its own selection of 256 colors, Macintosh has a different selection ... hey, there are a whole lot of Operating Systems out there!!

To solve this problem Netscape came with 'Web Safe Palette' of 216 colors, which can be displayed uniformly by most of the Operating Systems around.

Download web-safe palette. This is in the Microsoft Palette format (*.pal).

Select safe colors for your site online.

How to determine whether a color is web-safe?

Web-safe colors have only the following characters in them(in HTML hexadecimal values):

  • C
  • F
  • 0
  • 3
  • 6
  • 9
Eg.:
  #CCFF99 is web-safe
  #FFEFD5 is not web-safe


User Comments

Add Comment

[Quick Stats: Number of main threads: 0, Number of sub-threads: 0]

Sign Guestbook | Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.