Thames & Kosmos Code Gamer Experiment Manual page 23

Coding workshop ? game with kosmobits
Table of Contents

Advertisement

CodeGamer
CHECK IT OUT
In this close-up, you can easily see the three
individual LEDs of the NeoPixel. ▶
Additive
Color Mixing
What you see as white light is actually a mixture of different lights of
various colors. Which colors? Take a look at a rainbow and you will see them all. A rainbow is
created when the sun's light is split up into its component colors by raindrops in the air.
This process can also work in reverse when you mix light of various colors together, resulting in a
different color. Any color monitor or screen works by this principle — whether on your TV, your
computer, your smartphone or your tablet. In all these devices, each individual picture element
("pixel") consists of three single-colored picture elements of red, green, and blue. Because they are
packed so tightly together, you cannot perceive the individual dots from a normal distance. You can
only see the individual dots of color if you get really close, or use a magnifying lens.
If you look carefully at the NeoPixel on the interaction board, you will be able to see three different
regions (as long as it isn't shining). Each region can only produce one single color — red, green, or
blue. With the help of the
setColor()
method, you can tell the NeoPixel how brightly you want
each of the different regions to shine.
Experiment with mixing together other colors by
varying the individual color values. The picture next to the
table below will serve as a reference for anticipating which
mixtures will produce which colors. Enter your findings into
the following table:
▲ You can see
the component
colors of
sunlight in a
rainbow.
21
CodeGamer manual inside english.indd 21
7/19/16 12:32 PM

Advertisement

Table of Contents
loading

Table of Contents