Brendan Dawes
The Art of Form and Code

Dawesome Toolkit Update 0.9

A small update to the Dawesome Toolkit, my library for Processing.

It's sometimes handy to be able to get a list of the colours your Processing sketch uses, as you might need to use them in Photoshop, in a HTML page or something similar. The new exportColorsToHtmlSwatchGuide method allows you to export an array of colours to a handy HTML page, which you can then use as a reference.

import dawesometoolkit.*;
import processing.pdf.*;

final int BACKGROUND_COLOR = #000000;

// define some colors in an array
int[] colors = {BACKGROUND_COLOR, #9C9999,#FC7357,#EDEDE0};

DawesomeToolkit dawesome;

void setup(){
  size(640,640);
  dawesome  = new DawesomeToolkit(this);
  // create a html swatch page with our color array
  dawesome.exportColorsToHtmlSwatchGuide(colors);
  // you'll find colors.html in the same directory as your sketch
}

void draw(){
  background(BACKGROUND_COLOR);

}

The above code generates this HTML page:

Color Exporter generated HTML

You can download this new version over at the official site and it should also be available for updating in the Processing IDE.

To find out more about The Dawesome Toolkit, have a read of this introductory blog post.