Make clouds2d.js theme-agnostic
- Remove all hardcoded fallback hex/rgb values - Skip draw until __currentPalette is published by parent - applyWeatherTheme now also mixes cloudShadow (was dropped)
This commit is contained in:
1 parent
c6764fd534
commit
3812f80f40
3 files changed
+170
-46
No files matched your search
@@ -1416,6 +1416,9 @@ window.weatherThemes = {
|
||||
return {
|
||||
sky: mixColor(c.sky, themeColors.skyColor, mix),
|
||||
cloud: mixColor(c.cloud, themeColors.cloudColor, mix),
|
||||
cloudShadow: c.cloudShadow !== undefined
|
||||
? mixColor(c.cloudShadow, themeColors.cloudColor, mix * 0.8)
|
||||
: mixColor(c.cloud, themeColors.cloudColor, mix * 0.8),
|
||||
light: mixColor(c.sun, themeColors.lightColor, mix * 0.5),
|
||||
bg: mixColor(c.bg, themeColors.backgroundColor, mix)
|
||||
};
|
||||
@@ -1645,6 +1648,11 @@ window.weatherThemes = {
|
||||
var t = (Date.now() - startTime) / CYCLE % 1;
|
||||
var c = getColor(t);
|
||||
c = applyWeatherTheme(c);
|
||||
// Expose current palette + weather info for the 2D renderer
|
||||
window.__currentPalette = c;
|
||||
window.__currentWeatherName = currentWeatherThemeName;
|
||||
window.__currentDayProgress = realDayProgress;
|
||||
window.__currentThemeSpeed = currentThemeSpeed;
|
||||
effect.setOptions({
|
||||
skyColor: c.sky,
|
||||
cloudColor: c.cloud,
|
||||
|
||||
Reference in new issue
Block a user