O'Reilly logo

Foundation HTML5 Animation with JavaScript by Billy Lamberta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

images

Chapter 4

Trignometry for Animation

What we'll cover in this chapter:

  • Colors on the canvas
  • The drawing API
  • Loading images
  • Pixel manipulation

So far, the graphics drawn in the book example programs have used a few simple commands, and the “canvas drawing API” has been alluded to a number of times. But for the most part, the code has been provided without much explanation.

In this chapter, we look at creating visual content using the canvas element. Specifically, you'll see how to work with color using JavaScript, and take a brief tour of the canvas drawing API.

Colors on the canvas

Colors applied to the canvas element are specified using CSS-style ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required