RGB addition color description_basic tutorial

Source: Internet
Author: User
Tags color gamut
RGB addition colors indicate that RGB colors are called addition colors, because you can add R, G, and B Together (that is, all the light is reflected back to the eyes) to produce white. Bonus colors are used for lighting, television, and computer displays. For example, a display emits light in red, green, and blue colors.

The vast majority of the visual spectrum can be represented as a mixture of red, green, and blue (RGB) colors at different proportions and intensity. If these colors overlap, blue, red, and yellow are generated.

Color addition (RGB)
R. Red G. Green B. Blue
You can use the RGB color mode based on the RGB color model to process color values. In RGB mode, each RGB component can use a value from 0 (black) to 255 (white. For example, the R value 246, G value 20, and B value 50 are used in bright red. Gray shadows are generated when all three values are equal. When the value of all components is 255, the result is pure white; when the value is 0, the result is pure black.

The encoding method for a color is referred to as "Color Space" or "Color Gamut ". In the simplest words, any color space in the world can be defined as a fixed number or variable. RGB (red, green, and blue) is only one of the many color spaces. With this encoding method, each color can be represented by three variables-red green and blue intensity. R gb is the most common method for recording and displaying color images. However, it lacks good compatibility with early black/white display systems. Therefore, the common practice adopted by multiple electronic and electrical appliance manufacturers is to Convert RGB to YUV to maintain compatibility, and then switch back to the RGB format as needed, to display color images on computer monitors.

Because WEB pages are developed based on computer browsers, the colors are mainly optical RGB (red, green, and blue. The webpage color is represented by a hexadecimal code. The general format is # ZYZABC (replace letters with numbers). If black is three colors 0, the webpage code is: #000000. When the color code is # XXYYZZ, # XYZ can be used, for example, #135 and #113355 indicate the same color.

RGB ()
The function combines the three integers representing the three primary colors: Red, green, and blue into a long integer representing the color.
Syntax RGB (red, green, blue)
The red parameter is of the integer type. It specifies the intensity of the red component in the color. Valid values range from 0 to 255. green: integer type. Valid values range from 0 to 255. blue: integer type: Specifies the intensity of the blue component in the color. The valid value ranges from 0 to 255 and the return value is Long. When the function is successfully executed, the color determined by the specified component is returned, which is expressed as a long integer. -1 is returned when an error occurs. If the value of any parameter is NULL, the RGB () function returns NULL.
The RGB () function uses the following formula to calculate the long integer of the color: 65536 * Blue + 256 * Green + Red. Blue indicates the Blue component, and Green indicates the Green component, red indicates the Red weight. In each component, the smaller the value, the lower the brightness. The larger the value, the higher the brightness. For example, RGB (0, 0, 0) is black (lowest brightness), RGB (255,255,255) is white (highest brightness ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.