Pixels, Color and RGB

Pixels, Color and RGB#

In the previous step, we discussed that a pixel is essentially a dot or a square with a single color. If each pixel is a single color, how is color represented? Color is represented with the RGB model (Red, Green, Blue model). This means that a color is made up of some combination of red, green, and blue. This may be different from the expected red, yellow, and blue primary colors because these are colors as light, not as pigment (which absorbs light instead). Together, these three colors combined can describe the entire range of visible colors. We represent each of these colors with a number between 0-255. Zero means the color is completely “off” or not present and 255 means the color is completely “on” or present in its full intensity. You can take a look at all the possible combinations of RGB and the resulting color using a color picker. https://www.colorschemer.com/color-picker/

The model represents the color with 3 numbers where the first is red, the second is green, and the third is blue such that it resembles (Red, Green, Blue). If we wanted to represent the color red, we would use (255, 0, 0) because it turns red completely on and turns off all green and blue. We would do the same if we wanted green (0, 255, 0) or blue (0, 0, 255).

The color (255, 255, 255) represents white and (0,0,0) represents black. This is because a screen is black if it is off. Hence, we get black if all red, green, and blue lights are off and likewise we get white if all red, green, and blue lights are on.

We can also mix and match any amount of each color; play around with the color picker tool and see what colors you can create.