Hey all. I saw this website (http://colorblender.com/) that allows you to blend a color palette with interesting combinations. The site also allows you to download an adobe color palette out of the combination. So I thought, why not use this as a starting point for a palette class that loads in set colors?
This tiny lib allows you to load in .act files downloaded from that site and (presumably!) any adobe color palette files that are .act format. I haven't tested it out with Adobe products yet, but at least it will work with files from that site.
Note: The P5Extend is supposed to make life easier by not having to pass in PApplet to every new object you make for libraries, but I made a silly mistake of misplacing that class into the wrong package. So now, if you tried to use this lib along with my other one (Vertext) the two will fail. This is sad, and I'll have these two fixed soon.
I'll also build a nice little web page for this lib and add features if I think they'll be useful (cycle colors, add EPS color palette support, naming colors, etc).
Download:
http://www.ghost-hack.com/p5/palette/palette_010508.zip
Example:
Code:
import flux.graphics.*;
// make a new window
size(500,50);
// register the plugin
P5Extend.register(this);
// create a new palette from the file
// you can build a quick color palette from sites like:
// http://colorblender.com/
// this site allows you to save and download .act palette files
// place the file in your data folder
Palette palette = new Palette("colorblender_20080105125645.act");
noStroke();
// get the colors
int colors[] = palette.getColors();
// make a bunch of rectangles from the colors
float rectWidth = (float) width / colors.length;
float rectHeight = height;
for(int i=0; i<colors.length; i++){
fill(colors[i]);
float x = (float) i / colors.length * width;
float y = 0;
rect( x , y, rectWidth, rectHeight);
}