Hype

github.com / HYPE_Processing
by Joshua Davis and James Cruz
for Processing and ProcessingJS

HYPE_processing, is a collection of classes that performs heavy lifting tasks while using a minimal amount of code writing.
<< back

Your browser does not support the canvas tag.

HColorField / 001

HYPE, HColorField, HGridLayout

Source code
HDrawablePool pool;
HColorField colorField;

void setup() {
	size(640,640);
	H.init(this).background(#000000);
	smooth();

	colorField = new HColorField(width, height)
		.addPoint(0, height/2, #FF0066, 0.5f)
		.addPoint(width, height/2, #3300FF, 0.5f)
		.fillOnly()
		// .strokeOnly()
		// .fillAndStroke()
	;

	pool = new HDrawablePool(10000);
	pool.autoAddToStage()
		.add (
			new HRect()
		)

		.layout (
			new HGridLayout()
			.startX(20)
			.startY(20)
			.spacing(6,6)
			.cols(100)
		)

		.onCreate (
			new HCallback(){
				public void run(Object obj) {
					HDrawable d = (HDrawable) obj;
					d
						.noStroke()
						.fill(#000000)
						.size(5)
					;
					colorField.applyColor(d);
				}
			}
		)

		.requestAll()
	;

	H.drawStage();
	noLoop();
}

void draw() {}