ScratchData LogoScratchData
Back to crkcity's profile

RGB color cube

CRcrkcity•Created August 27, 2020
RGB color cube
2
2
53 views
View on Scratch

Instructions

Click green flag. Watch the code draw one side of the red-green-blue color cube. Press key "a" for a blue and green mix (aqua), which is one side of the RGB color cube. Then hit green flag. Press key "v" for a red and blue (violet) mix. Then hit green flag. Press "y" for a mix of red and green (yellow). Hit the green flag. It may surprise you that red and green light mixed together make yellow. This way you can create three of the six sides of the color cube. To get the other three sides you can also press "w" for white (setting your third color to maximum) or "b" for black (setting the third color to zero). Hit the space key to erase.

Description

This cube is a model of how computers use code to generate a wide range of colors. Think of each color as a dimension in space, as on an x, y and z axis. On this screen you will see just 2 dimensions, for example red going from zero red to maximum red along the x axis and green going from zero to maximum along the y axis. But if you were to print the screen and paste all the possible pictures together, you would also have a z axis, and so a full three-dimensional cube of colors. We had to use special code to translate the usual scratch code for color into the standard RGB code, which uses three numbers: one for red, one for green and one for blue, each ranging from 0 to 255 (256 values). This is the standard way computers code for RGB for the pixels on a screen. The three dimensions of color using space, is an example of a "property space." The property in this case is color.

Project Details

Project ID420554322
CreatedAugust 27, 2020
Last ModifiedOctober 10, 2021
SharedSeptember 8, 2020
Visibilityvisible
CommentsAllowed