1. Home
  2. Computing & Technology
  3. JavaScript

Watercolour Mixer

1. Introduction and Sample

clr gif
Join the Discussion

Questions? Comments?

More of this Feature

Stylesheet/HTML Javascript

Here's a colour mixing script with a bit of a difference from what you normally find on the web. Most of the colour mixers you are likely to find on the web mix red, green, and blue (the three colours you mix together to get all of the millions of colours that can be displayed on the computer screen). Those scripts are fine when you are mixing for the screen but useless when you are tring to work out what will happen if you start mixing paint.

Paint mixing involves the primary colours red, yellow, and blue rather than red, green, and blue because we are no longer working with light but rather with the reflective properties of a substance such as paint.

It isn't the purpose of this article to discuss why the primary colours for paint are different from those on the screen. Instead let's move on and look at a demo of the script.

Paints (primary)
Mixing Area
Paints (secondary)

To use the paint colour mixer simply click on a paint colour on the left to add some of that colour to the mixing area. Click on the mixing area or reset button to start over. The percentages indicate the proportions of the primary colours used.

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

Explore JavaScript
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

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

  1. Home
  2. Computing & Technology
  3. JavaScript

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

All rights reserved.