In the RGB space, the pixel color is stored in the form of three values corresponding to the three components R, G and B.
- The R component (Red) is responsible for the amount of red.
- Component G (Green) is responsible for the amount of green
- Component B (Blue) is responsible for the amount of blue.
In the most commonly used 24-bit color notation, all three components can take values from 0 to 255. Where 0 means no saturation of a given color and 255 means its maximum value. For example, a pixel with the values RGB – R: 255 G: 0 B: 0 will be pure red with maximum saturation.
The black color can be obtained by setting the RGB components to the minimum values, ie 0.0.0. We will achieve white color if the RGB components have maximum values, i.e. 255,255,255.
If all RGB components have the same value, we will get gray. The larger the values, the lighter the gray, the smaller the values – the darker.
Any color can be achieved by appropriate setting of the individual components. There are as many as 16.7 million color combinations.
The representation of colors in the RGB color space is used in most graphics intended for display on monitors and electronic displays.
In the CMYK color space, colors are expressed by four components corresponding to the colors used in printing:
- C (Cyan)
- M (Magenta)
- Y (Yellow)
- B (Black)
The values adopted by individual components are expressed as percentages – from 0 to 100%. Percentages represent the amount of a given component in the mixture that forms the result color.
The CMYK color space was created mainly for printed materials and is used during the preparation of materials for printing.
For example, to achieve black in CMYK space, we need to set all components to the maximum value (the opposite is the case in RGB). CMYK values for black: C: 100%, M: 100%, Y: 100%, K: 100%. Similarly, the white color can be achieved by setting all components to the minimum value: C: 0%, M: 0%, Y: 0%, K: 0%.