Skip to content
vormplus edited this page Oct 27, 2014 · 1 revision

The Tetrad class is used to create an tetrad color palette. It extends the Palette class, which means you can use all methods from the Palette class.

p1 = new Triad( this, c, 80 );
p2 = new Triad( this ).setColor( color( 0, 0, 255 ) ).setAngle( 40 );

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.*;

Triad p1, p2;

void setup()
{
	size( 200, 200 );
	smooth();
	noStroke();
	   
	color c = color( 255, 255, 0 );
	
	p1 = new Triad( this, c, 80 );
	p2 = new Triad( this ).setColor( color( 0, 0, 255 ) ).setAngle( 40 );
}

void draw()
{
	background( 0 );
	translate( 10, 10 );
	p1.drawSwatches();
	
	translate( 0, 50 );
	p2.drawSwatches( 180, 60 );
}

Clone this wiki locally