override fun settings() { size(800, 480, PConstants.P3D) } override fun setup() { colorMode(PConstants.HSB, 360f, 100f, 100f) } override fun draw() { background(0) noFill() strokeWeight(PApplet.map(sin(millis() / 1000f), -1f, 1f, 2f, 12f)) stroke( PApplet.map(sin(millis() / 1000f), -1f, 1f, 0f, 360f), // Hue 100f, // Sat 100f // Brightness ) translate(width / 2f, height / 2f) rotateY(millis() / 1200f) rotateZ(millis() / 2000f) box(width / 5f) } } DEMO TIME