Rainbow

Heather Arthur has been busy finding a creative new use for canvas with Rainbow, a browser extension for Firefox.

I wanted to grab the color scheme of whatever website the user is viewing… The problem with getting the colors from the DOM is that websites use images and gradients so sometimes you can’t get the overall color scheme just from looking at the CSS colors. Luckily, you can capture the color of every pixel on a webpage from an extension using the HTML 5 standard canvas.

Twitter's colour palette

Twitter's colour palette

Browser extension Rainbow draws the entire webpage on to a canvas using the drawWindow function. It gets an array of pixel values used with the getImageData function and then loops through each pixel value in the array counting each colour’s frequency. Hierarchical clustering is then used to merge similiar colours before returning the final palette.

Info

Type:
Extensions, Tools
Author:
Heather Arthur
Posted on:
January 5th, 2010
Posted by:
Andi Smith
Views:
2428

Rating

4

Your Rating:
1 Star2 Stars3 Stars4 Stars5 Stars

Works on

BETA Please let us know if you find Rainbow works in other browsers by leaving a comment below.

Add comment

(required)
(required)
(will not be published)
(required)