RGB color model

RGB color model

RGB color model

The RGB color model is an additive model in which red, green and blue light are combined in various ways to reproduce other colors. The name of the model and the abbreviation "RGB" come from the three primary colors, Red, Green and Blue, often used in additive light models.

A color in the RGB color model can be described by indicating how much of each of the red, green and blue color is included. Each can vary between the minimum (no color) and maximum (full intensity). If all the colors are at minimum the result is black. If all the colors at maximum, the result is white. A confusing aspect of the RGB color model is that these colors may be written in several different ways.

bullet Color science talks about colors in the range 0.0 (minimum) to 1.0 (maximum). Most color formulae take these values. For instance, full intensity red is 1.0, 0.0, 0.0;
bullet The color values may be written as percentages, from 0% (minimum) to 100% (maximum). To convert from the range 0.0 to 1.0, just multiply by 100. Full intensity red is 100%, 0%, 0%;
bullet The color values may be written as numbers in the range 0 to 255, simply by multiplying the range 0.0 to 1.0 by 255. This is commonly found in computer science, where programmers have found it convenient to store each color value in one 8-bit byte. This convention has become so widespread that many writers now consider the range 0 to 255 authoritative and do not give a context for their values. Full intensity red is 255,0,0;
bullet The same range, 0 to 255, is sometimes written in hexadecimal, sometimes with a prefix (e.g. #). Because hexadecimal numbers in this range can be written with a fixed two digit format, the full intensity red #ff, #00, #00 might be contracted to #ff0000. This convention is used in web colors and is also considered by some writers to be authoritative.