In this exercise, you'll create your own pixel art maker which will allow a user to choose colors from a palette and then paint pixel art. The interface is completely up to you, but it could look something like this.
More specifically, your pixel art maker should allow a user to do the following.
- Start with a blank canvas of pixels.
- Select a brush color from a palette of colors.
- Paint the pixels on the canvas using the brush color.
- Repeat step 2.
Here's a development workflow that we recommend you use.
- Fork and clone this repository.
- Create a small, 2x2 grid canvas made up of white, square
div
tags with a border. - Add an event listener to each
div
so when clicked the background turns red. - Create a small palette of two colors (e.g. red and blue) below the canvas using more
div
tags. - Add an event listener to these
div
tags so when clicked the brush color is saved. - Expand the dimensions of the pixel canvas.
- Expand the palette with more colors. (i.e. red, orange, yellow, green, blue, purple, brown, gray, black, white, etc.)
- Expand the palette with a brush color indicator.
- Improve the look and feel of the canvas and color palette. Be careful not to break your program's behavior!
TIP: Check out this handy tool to see a list of all the named colors in CSS.