Fixing a bug with tint RGB rounding; it was previously not working at all.

This commit is contained in:
mattdesl 2014-01-12 21:25:32 -05:00
parent ea52c488b0
commit 7f3df3d8ce

View file

@ -171,9 +171,9 @@ PIXI.CanvasTinter.roundColor = function(color)
var rgbValues = PIXI.hex2rgb(color); var rgbValues = PIXI.hex2rgb(color);
rgbValues[0] = Math.round(rgbValues[0] * step) / step; rgbValues[0] = Math.min(255, Math.round(rgbValues[0] / step) * step);
rgbValues[1] = Math.round(rgbValues[1] * step) / step; rgbValues[1] = Math.min(255, Math.round(rgbValues[1] / step) * step);
rgbValues[2] = Math.round(rgbValues[2] * step) / step; rgbValues[2] = Math.min(255, Math.round(rgbValues[2] / step) * step);
return PIXI.rgb2hex(rgbValues); return PIXI.rgb2hex(rgbValues);
}; };