Colors for Web

Graphic cards use the RGB system, Red Green Blue, each color can have values between 0 and 255 that are combined to form the color tones in the screen.

For example, the color yellow is formed by 100% of red, 100% of green and 0% of blue, is {255,255,0} in RGB format. In HTML or CSS, the colors are typically used in the hexadecimal system (base 16), yellow will be encoded as #FFFF00.

Previously, the monitors only support 256 colors, which limited the amount of available tones. Nowadays the monitors work with millions of colors, but still there are Web safe colors, combining the three RGB color intensities 100% (255 decimal / FF hexadecimal), 80% (204 / CC), 60% (153 / 99), 40% (102 / 66), 20% (51 / 33) and 0% (0 / 00).

You can find a table with colors hue.
You can find a table with Web safe colors.
You can find a table with a long list of colors with their names.

The Web safe colors consists in 216 colors supported between browsers and different platforms and organized by its hues. The hue is the characteristic of the color best distinguished by the human eye.

Each color is defined by its hue, saturation and lightness.
Saturation - The saturation decreases with the addition of the gray.
Brightness - The brightness increases with the addition of white.

Some colors have names assigned by the W3C, which are recognized by any Web browser:
white
#FFFFFF
silver
#C0C0C0
gray
#808080
black
#000000
aqua
#00FFFF
teal
#008080
fuchsia
#FF00FF
purple
#800080
blue
#0000FF
navy
#000080
lime
#00FF00
green
#008000
yellow
#FFFF00
olive
#808000
red
#FF0000
maroon
#800000

In HTML you can use any of the options:

<font color="red">
<font color="#FF0000">

In CSS the color can be abbreviated, FF may be replaced by F, 33 by 3, and so on. So we have the following possibilities:

{Color: lime;}
{Color: #00FF00;}
{Color: #0F0;}
{Color: rgb(0,255,0)}

Sometimes it is useful to use other colors that are not in safe color palette, to determine the RGB value you can use a program that displays the color and the RGB values, such as Paint in Windows.

Color Palette of MS Paint

A quick and easy way to calculate the conversion between RGB and hexadecimal is to use the Windows calculator, you just put the calculator in "scientific" or "programmer" (tab 'View' in tools bar), put a decimal value (RGB) and click on "Hex", can also learn to do the math on Number Systems.

Calculator in Decimal and Hexadecimal



Thus, the color 128, 128, 255 in RGB is #8080FF in Hex, resulting in this color.

Even though some sites get better with special colors, whenever possible you should try to use web safe colors. It is important to take care with accessibility issues, also don't forget that some users have special needs, for example, they can only see colors in high contrast or use a screen reader.
Don't forget to document all all images.