Join Joe Marini for an in-depth discussion in this video Colors and styles, part of Learning HTML Canvas.
- [Instructor] In this chapter we'll learn about the…basic canvas drawing operations.…And we'll start with colors and styles.…The canvas 2D drawing context provides some global…properties that affect how objects are stroked and filled.…The first is fill style which specifies the style to use…when filling a shape.…It can be set to a CSS color property or a gradient,…or a pattern, and it defaults to black if you don't set it.…Next is stroke style, and this is essentially the same…as fill style except this is the color or a style that's…used when strokes are drawn, usually lines or outlines…of other objects.…
The line width property specifies the width of the drawing…pen that the canvas uses when drawing lines,…and that defaults to a width of one pixel.…And you can see here some examples of the kinds of values…you can set the style fields to.…So I can use a named CSS color, or a hex value,…or an RGB code.…So essentially anything you can use for CSS,…you can use in these properties.…So let's take this new information and try it out…
- Canvas examples
- Drawing shapes, arcs, paths, and curves
- Drawing text
- Drawing shadows, patterns, and gradients
- Using clipping paths
- Displaying images and video
- Transforming objects with scaling and rotation
- Manipulating raw pixels
- Applying transitions
- Creating animations
Skill Level Intermediate
1. Overview of Canvas
2. Basic Canvas Drawing Techniques
3. Complex Canvas Drawing
4. Advanced Drawing APIs
5. Practical Examples
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.