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.

HOscillator / 009

HYPE, HCanvas, HPath, HColorPool, HOscillator / ROTATION

! HColorPool / randomSeed in Java renders differently in JavaScript

Source code
HColorPool colors;
HCanvas canvas;

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

	colors = new HColorPool(#FFFFFF, #F7F7F7, #ECECEC, #ff3300, #ff3300, #242424, #333333, #666666);

	canvas = H.add(new HCanvas()).autoClear(true);

	int starScale = 800;
	int starOffest = 15;

	for (int i=0; i<53; ++i) {
		HPath d = (HPath) canvas.add( new HPath().star(5, 0.5, -90) )
			.size(starScale)
			.noStroke()
			.fill( colors.getColor(i*250) )
			.anchorAt(H.CENTER)
			.locAt(H.CENTER)
		;

		new HOscillator()
			.target(d)
			.property(H.ROTATION)
			.range(-20, 20)
			.speed(0.4)
			.freq(8)
			.currentStep(i)
		;

		starScale -= starOffest;
	}
}

void draw() {
	H.drawStage();
}