kopia lustrzana https://github.com/backface/turtlestitch
fix negative color effect in objects.js
In JS, foo%360 gives a negative remainder if the dividend is negative. This one-line change from developer.mozilla.org computes the correct modulo. I should have called this branch "color" not "ghost", oops.pull/95/head
rodzic
3ac1e456a5
commit
f8fc66247f
|
@ -5113,7 +5113,7 @@ SpriteMorph.prototype.applyGraphicsEffects = function (canvas) {
|
||||||
}
|
}
|
||||||
v = max / 255;
|
v = max / 255;
|
||||||
|
|
||||||
h = (h + hueShift * 360 / 200) % 360;
|
h = (((h + hueShift * 360 / 200) % 360)+360)%360;
|
||||||
s = Math.max(0, Math.min(s + saturationShift / 100, 1));
|
s = Math.max(0, Math.min(s + saturationShift / 100, 1));
|
||||||
v = Math.max(0, Math.min(v + brightnessShift / 100, 1));
|
v = Math.max(0, Math.min(v + brightnessShift / 100, 1));
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue