visuals now adhere to theme by default

This commit is contained in:
Felix Roos 2024-03-28 10:23:07 +01:00
parent 6a2486d9f2
commit c400deac74
6 changed files with 34 additions and 13 deletions

View file

@ -68,7 +68,7 @@ Pattern.prototype.draw = function (fn, options) {
fn(memory[id], _t, t, this);
animationFrames[id] = requestAnimationFrame(animate);
};
requestAnimationFrame(animate);
animationFrames[id] = requestAnimationFrame(animate);
return this;
};
@ -183,3 +183,18 @@ export class Drawer {
}
}
}
export function getComputedPropertyValue(name) {
if (typeof window === 'undefined') {
return '#fff';
}
return getComputedStyle(document.documentElement).getPropertyValue(name);
}
let theme = {};
export function getTheme() {
return theme;
}
export function setTheme(_theme) {
theme = _theme;
}