Categories

RGB

Sandra Kim July 11, 2016
No votes yet.
Please wait...

RGB (stands for “Red Green Blue”), or RGB Color Model, refers to a system for representing the colors to be used in computer graphics. The main purpose of the RGB color model is for the sensing, representation, and display of images in electronic systems, such as televisions and computers. Colored images are often stored as separate red, green and blue overlays or as a sequence of RGB triplets.

Red, green, and blue colors can be combined in various proportions to obtain any other color. In CSS, the color for a page background or text font is specified by an RGB value, expressed with six digits in hexadecimal format, starting with a # sign. The first and second digits represent the red level; the third and fourth digits represent the green level; the fifth and sixth digits represent the blue level. For example:

	#p1 {background-color: #ff0000;}   /* red */
	#p2 {background-color: #00ff00;}   /* green */
	#p3 {background-color: #0000ff;}   /* blue */

Levels of R, G, and B can each range from 0 to 100 percent of full intensity. Each level is represented by the range of decimal numbers from 0 to 255 (256 levels for each color), equivalent to the range of hexadecimal numbers from 00 to FF. For example:

	#p1 {background-color: rgb(255, 0, 0);}   /* red */
	#p2 {background-color: rgb(0, 255, 0);}   /* green */
	#p3 {background-color: rgb(0, 0, 255);}   /* blue */

When the highest intensity of each color is mixed together, white light is created. When each hue is set to zero intensity, the result is black. The total number of available colors is 256 x 256 x 256, or 16,777,216 possible colors.

The RGB color model is the most prevalent choice for computer graphics because color displays use red, green, and blue to create the desired color. Therefore, the choice of the RGB color model simplifies the architecture and design of the system.

However, in creating web pages, the number of RGB values that are recommended for use is considerably reduced. First, by the fact that many displays can handle only 256 colors and, secondly, because the majority of browsers can handle 40 of these 256 colors slightly differently. Also, in order to actually display the colors for all possible values, the computer display system must have 24 bits to describe the color in each pixel. In display systems or modes that have fewer bits for displaying colors, an approximation of the specified color will be displayed.

You can refer to this documentation to learn more about using the RGB color model in CSS.
Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket

Comments are closed.