RGB Lab Challenges

Think you understand it?  Try some of these challenges.  It is HIGHLY recommended that you learn Scratch first before attempting these.

Challenge 1

Create a program that makes red get gradually brighter when you hold down the space key, and fade to off when you release the space key.

Extra challenge:  Do this in less than 12 scripts!

Challenge 1 ANSWER

Challenge 2

Create a program that does the following:

  1. pressing a increases red power by 5
  2. pressing s increases green power by 5
  3. pressing d increases blue power by 5
  4. pressing z decreases red power by 5
  5. pressing x decreases green power by 5
  6. pressing c decreases blue power by 5
  7. pressing space puts all RGB to zero

From this program, figure out what power levels give you the following colors:

  • purple
  • pink
  • orange

Record it in a table like the following:

Color Red Power Green Power Blue Power

Challenge 2 ANSWER

Challenge 3

Modify the script for Challenge 2 so that it cannot go above the limit of 255 for any power level or below 0 for any power level!

Challenge 3 ANSWER