im getting tired of debugging like this
This commit is contained in:
parent
6c866b37fe
commit
df986ff032
1 changed files with 10 additions and 10 deletions
20
lights.js
20
lights.js
|
@ -82,24 +82,24 @@ function fade(index) {
|
|||
var current_tick_b = Math.abs(Math.floor((diff_cb / diff_b) * fade_ticks));
|
||||
if (diff_r == 0) {
|
||||
current_tick_r = fade_ticks;
|
||||
} else if (Math.abs(current.r + interval_r) >= Math.abs(final.r)) {
|
||||
current.r = final.r;
|
||||
interval_r = 0;
|
||||
current_tick_r = fade_ticks;
|
||||
}
|
||||
if (diff_g == 0) {
|
||||
current_tick_g = fade_ticks;
|
||||
} else if (Math.abs(current.g + interval_g) >= Math.abs(final.g)) {
|
||||
current.g = final.g;
|
||||
interval_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;
|
||||
}
|
||||
if (Math.abs(current.g + interval_g) >= Math.abs(final.g)) {
|
||||
current.g = final.g;
|
||||
interval_g = 0;
|
||||
}
|
||||
if (Math.abs(current.b + interval_b) >= Math.abs(final.b)) {
|
||||
} else if (Math.abs(current.b + interval_b) >= Math.abs(final.b)) {
|
||||
current.b = final.b;
|
||||
interval_b = 0;
|
||||
current_tick_b = fade_ticks;
|
||||
}
|
||||
|
||||
if (current_tick_r + 1 >= fade_ticks &&
|
||||
|
|
Loading…
Reference in a new issue