tirstsrt
This commit is contained in:
parent
5ce6777157
commit
6c866b37fe
1 changed files with 9 additions and 6 deletions
15
lights.js
15
lights.js
|
@ -80,12 +80,15 @@ function fade(index) {
|
|||
var current_tick_r = Math.abs(Math.floor((diff_cr / diff_r) * fade_ticks));
|
||||
var current_tick_g = Math.abs(Math.floor((diff_cg / diff_g) * fade_ticks));
|
||||
var current_tick_b = Math.abs(Math.floor((diff_cb / diff_b) * fade_ticks));
|
||||
|
||||
// console.log(`original: ${original.r} ${original.g} ${original.b}\n` +
|
||||
// `current: ${current.r} ${current.g} ${current.b}\n` +
|
||||
// `final: ${final.r} ${final.g} ${final.b}\n` +
|
||||
// `interval: ${interval_r} ${interval_g} ${interval_b}\n`)
|
||||
|
||||
if (diff_r == 0) {
|
||||
current_tick_r = fade_ticks;
|
||||
}
|
||||
if (diff_g == 0) {
|
||||
current_tick_g = fade_ticks;
|
||||
}
|
||||
if (diff_b == 0) {
|
||||
current_tick_b = fade_ticks;
|
||||
}
|
||||
if (Math.abs(current.r + interval_r) >= Math.abs(final.r)) {
|
||||
current.r = final.r;
|
||||
interval_r = 0;
|
||||
|
|
Loading…
Reference in a new issue