0102 - Arithmetic and Color: Shifting and Scaling
Request a canvas of size 300x300 pixels. Declare three float variables: R,G,B. Assign these variables to have values which would produce a nice color of medium brightness.
Use R,G,B to govern the color of a rectangle on the canvas. In other words, incorporate R,G, and B into the syntactic slots for a fill() command, and draw a rectangle with that color. Now draw the following additional rectangles:
- Use additive factors to create a related color which is lighter than the first color. In other words, add some values to R,G,B, to produce a related tint of that color. Fill a second rectangle with this.
- Use additive factors to create a related color which is darker than the first color. In other words, add some values to R,G,B, to produce a related shade of that color. Fill a third rectangle with this.
- Use multiplicative factors to create a related color which is brighter than the first color. In other words, multiply R,G,B, by some values to produce a brighter member of that color's family. Fill a fourth rectangle with this.
- Use multiplicative factors to create a related color which is darker than the first color. In other words, multiply R,G,B, by some values to produce a darker member of that color's family. Fill a fifth rectangle with this.