1. Home
  2. Computing & Technology
  3. JavaScript

Paint Mixer

1. Introduction and Sample

clr gif
Join the Discussion

Questions? Comments?

More of this Feature

Stylesheet/HTML Javascript

Here is another paint mixer script. Unlike my Watercolour Mixer, this script works only with solid primary and secondary colours and not "watered down" colours. Each click on a colour corresponds to an equivalent sized load of paint that is added to however many lots of paint have already been added to the mixing area. The colour of the mixing area is then changed to reflect the addition of this unit of colour to how ever many units of colour have previously been added to the area (so mixing one lot of yellow to five lots of red will give a different result than if you used just one lot of each). The number of portions of each primary colour are displayed at the top right corner of each.



Paints (primary)
Mixing Area
0
0
0
Paints (secondary)

The only way to remove paint from the mixing area is to either click on the mixing area or the reset button and start over from the beginning.

If you want to add a copy of this paint mixer to your site then there are two Javascripts, a stylesheet, and some HTML that you need to use. Let's start with the Paint mixer stylesheet.

Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.