Color Cycle

This tutorial will explore some variations on the color cycle example from "Meet the Canvas." It includes instructions on animation and some basic user controls.

Basic Color Cycle

This effect consists of a rectangle that fills the entire canvas and changes color over time. The user can edit the speed of the color shift.

Basic
Copy

The result is colorful but basic. We can do more with the canvas!

Gradient Color Cycle

Here, I've replaced the single color with a gradient that shifts over time. The user can edit the speed of the color shift, as well as the distance of each gradient point from the rest.

Gradient
Copy

Pixelated Color Cycle

This one got a little complicated, so bear with me on the math. Our final color cycle is a pixelated, snake-like color crawl.

Snake
Copy

I hope you had some fun working on color cycles! For a tutorial involving class-based behavior and some minor physics, check out the Ball Class page.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard