sketch.js: initial support for dark/light mode logic
This commit is contained in:
parent
f41b131563
commit
cf5b81ec8b
|
|
@ -42,7 +42,7 @@ class RotatingOnion {
|
||||||
scale(this.scale);
|
scale(this.scale);
|
||||||
model(onion_stroke);
|
model(onion_stroke);
|
||||||
push()
|
push()
|
||||||
emissiveMaterial(0,0,0)
|
emissiveMaterial(backgroundColor)
|
||||||
model(onion_fill);
|
model(onion_fill);
|
||||||
pop()
|
pop()
|
||||||
|
|
||||||
|
|
@ -191,6 +191,9 @@ function setup() {
|
||||||
textAlign(CENTER, CENTER);
|
textAlign(CENTER, CENTER);
|
||||||
randomSeed()
|
randomSeed()
|
||||||
|
|
||||||
|
// Background color
|
||||||
|
backgroundColor = [0, 0, 0];
|
||||||
|
|
||||||
// Initialize camera to get its position
|
// Initialize camera to get its position
|
||||||
camera = createCamera();
|
camera = createCamera();
|
||||||
|
|
||||||
|
|
@ -216,7 +219,7 @@ function setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
background(0);
|
background(backgroundColor);
|
||||||
orbitControl();
|
orbitControl();
|
||||||
ambientLight(100);
|
ambientLight(100);
|
||||||
shininess(0);
|
shininess(0);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue