You can do draw interesting stuff just by messing around with colors. The canvas' fillStyle property takes your typical CSS color strings, like rgb(255, 0, 0), and you can change those values incrementally to get a gradient-like effect. Note that if all you want is a gradient, there are simpler methods you can use.
Using RGB to explore color space programmatically has some issues though: it’s hard to avoid hitting unwanted whites, blacks and browns. Using HSL (hue / saturation / value) is much better suited to doing this, because you can change the colors by adjusting the hue parameter, without affecting how dark, light or washed-out the image is.
You can produce some easy, fun designs using just the repeating shapes and color changes we've covered:
You can describe structures and patterns using a small amount code if you make use of recursion: a function calling itself. A simple case is “draw a shape, then draw another smaller copy next to it”:
In addition to legions of pac-men, you can describe detailed and beautiful structures using recursion. Trees (shown below), the Sierpinski triangle, and fractals can all be described in a suprisingly terse manner.