Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var intervalTime = 3000; /*Milliseconds between color changes
- 500 = Fast, smooth-ish, resource intensive.
- 500-2500 = Glitchy for most people.
- 3000-4000 = Slow, very smooth, least resource intensive.
- 4000+ = Feel free to make it as slow as you want. You do you. */
- var colorList = ["#000000", "#AAAAAA"]; //Put whatever hex colors you want, and however many you want.
- var counter = 0;
- function updateColor(color) {
- MPP.client.sendArray([{
- m: 'chset',
- set: {
- color: '#' + color
- }
- }])
- };
- var foo = setInterval(function() {
- if (counter < colorList.length - 1) {
- counter++;
- updateColor(`${colorList[counter]}`)
- } else {
- counter = 0;
- updateColor(`${colorList[counter]}`)
- }
- }, intervalTime);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement