RGB colors are called bonus colors because you can produce white by adding R, G, and B Together (that is, all the light is reflected back to the eyes. 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 in hexadecimal format.CodeThe general format is # zyzabc (replace letters with numbers). If black is 0 in three colors, 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 ()
This function combines three integers representing the primary colors of red, green, and blue into one long integer representing the color.
syntax RGB (red, green, blue)
parameter RED: Integer type, specifies the intensity of the red component in the color. Valid values are between 0 and 255. Green: Integer type, specify the green component strength in the color. Valid values are between 0 and 255. Blue: Integer type. Specify the blue component strength in the color. Valid values are between 0 and 255. 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.
use the RGB () function to calculate the long integer representing the color using the following formula: 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 ).