How are color names, RGB color values, and hexadecimal color values used?

What will be an ideal response?

Using Color Names: The color name values let you quickly state color using common names. Although the color names are easy to use, they allow only a small range of color expression. To use a wider variety of available color, you must use a more specific value, such as RGB or hexadecimal.

Using RGB Color Values: The RGB color model is used to specify numeric values that express the blending of the red, green, and blue color channels.When you specify RGB values, you are mixing the three basic colors to create a fourth color. Each of the three color channels can be specified in range from 0 to 100%, with 0 representing the absence of the color, and 100% representing the full brilliance of the color. If all three values are set to 0, the resulting color is black, which is the absence of all color. If all three color values are set to 100%, the resulting color is white, which is the inclusion of all colors.

The syntax for specifying RGB is the keyword rgb followed by three numerical values in parentheses-the first for red, the second for green, the third for blue.The following rule states a percentage RGB value:

            p {color: rgb(0, 100%, 100%);}

RGB color values can be specified as an integer value as well. The integer scale ranges from 0 to 255 with 255 equal to 100%.The following rules specify the same color:

            p {color: rgb(0%, 100%, 100%);}  /* percentages */
            p {color: rgb(0, 255, 255);}            /* integers */


Using Hexadecimal Color Values: HTML uses hexadecimal numbers to express RGB color values, and you can use them in CSS as well. Hexadecimal numbers are a base-16 numbering system, so the numbers run from 0 through 9 and then A through F. When compared to standard base-10 numbers, hexadecimal values look strange because they include letters in the numbering scheme. Hexadecimal color values are six-digit numbers; the first two define the red value, the second two define the green, and the third two define the blue. The hexadecimal scale ranges from 00 to FF with FF equal to 100%. Hexadecimal values are always preceded by a pound sign (#).The following rules specify the same color:

            p {color: #00FFFF;}                      /* hexadecimal */
            p {color: rgb(0%, 100%, 100%);}   /* percentages */
            p {color: rgb(0, 255, 255);}             /* integers */

Computer Science & Information Technology

You might also like to view...

Are there any disadvantages to prototyping? If so, what are they?

What will be an ideal response?

Computer Science & Information Technology

What term is used to describe the metadata that accompanies a packet?

What will be an ideal response?

Computer Science & Information Technology