Trichromatic Vision

The human eye has two different types of cells that respond to light.

There are three types of cone cells, each with different color sensitivities.

Any color humans see is a mixture of these three primary colors.

Red
Green
Blue

Secondary colors have equal mixtures of two primary colors.

Yellow: Red and Green
Cyan: Green and Blue
Magenta: Blue and Red

Computer Display Color - 24 bit RGB colors

The color of each pixel is a mixture of red, green, and blue, or RGB. The amount of each color is represented by a number from 0 - 255. In hex, each color ranges from 0 - FF.

ColorDecimal RangeHex Range
Red (R)0 - 2550 - FF
Green (G)0 - 2550 - FF
Blue (B)0 - 2550 - FF

Color Demonstration

Link to color demo

Creating Color with Racket

Use the make-color function to create any 24-bit color.

;; make-color : number number number -> color

;; example - to create red (make-color 255 0 0)

Computer Programming Unit 2.3B - Images Part 2 - Color