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);
|
||||
model(onion_stroke);
|
||||
push()
|
||||
emissiveMaterial(0,0,0)
|
||||
emissiveMaterial(backgroundColor)
|
||||
model(onion_fill);
|
||||
pop()
|
||||
|
||||
|
|
@ -191,6 +191,9 @@ function setup() {
|
|||
textAlign(CENTER, CENTER);
|
||||
randomSeed()
|
||||
|
||||
// Background color
|
||||
backgroundColor = [0, 0, 0];
|
||||
|
||||
// Initialize camera to get its position
|
||||
camera = createCamera();
|
||||
|
||||
|
|
@ -216,7 +219,7 @@ function setup() {
|
|||
}
|
||||
|
||||
function draw() {
|
||||
background(0);
|
||||
background(backgroundColor);
|
||||
orbitControl();
|
||||
ambientLight(100);
|
||||
shininess(0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue