Created
December 26, 2019 15:32
-
-
Save Anime4000/f5c8df8f4cd1af58caf2d73b14a4974e to your computer and use it in GitHub Desktop.
Day Night Wallpaper Engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import * as WEMath from 'WEMath'; | |
/** | |
* @param {Number} value (for property 'multiply') | |
*/ | |
export function update(value) { | |
var t = engine.timeOfDay; | |
if (t <= 0.5) { | |
return t * 2; | |
} | |
else {; | |
return Math.abs(mod((t * 2) * 10, -10) * 0.1); | |
} | |
return t; | |
} | |
function mod(n, m) { | |
return ((n % m) + m) % m; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment