-
Notifications
You must be signed in to change notification settings - Fork 10
Complement
vormplus edited this page Oct 27, 2014
·
1 revision
The Complement class is used to create an complementary color palette. It extends the Palette class, which means you can use all methods from the Palette class.
p1 = new Complement( this, c );
p2 = new Complement( this ).setColor( color( 255, 0, 0 ) );
This is the full code for the sketch, you can also find it in the examples folder that comes with the colorLib download.
import colorlib.webservices.*;
import colorlib.tools.*;
import colorlib.*;
Complement p1, p2;
void setup()
{
size( 200, 200 );
smooth();
noStroke();
color c = color( 255, 255, 0 );
p1 = new Complement( this, c );
p2 = new Complement( this ).setColor( color( 255, 0, 0 ) );
}
void draw()
{
background( 0 );
translate( 10, 10 );
p1.drawSwatches();
translate( 0, 50 );
p2.drawSwatches( 180, 60 );
}