-
Notifications
You must be signed in to change notification settings - Fork 10
Tinted
vormplus edited this page Oct 27, 2014
·
1 revision
The Tinted class is used to create an shaded color palette based on a color. It does this by mixing the color with white. The end result is a color palette with six colors. The Tinted class is closely related to the Shaded class, which mixes a color with black, and the Toned class, which mixes a color with a neutral gray.
The Tinted class extends the Palette class, which means you can use all methods from the Palette class.
You can create a Tinted color palette with one of the constructors below.
p1 = new Tinted( this, c );
p2 = new Tinted( 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.*;
Tinted p1, p2;
void setup()
{
size( 200, 200 );
smooth();
noStroke();
color c = color( 255, 255, 0 );
p1 = new Tinted( this, c );
p2 = new Tinted( this ).setColor( color( 255, 0, 0 ) );
}
void draw()
{
background( 0 );
translate( 10, 10 );
p1.drawSwatches();
translate( 0, 50 );
p2.drawSwatches( 180, 60 );
}