fponticelli / thx.color

General purpose color library for Haxe
http://thx-lib.org
MIT License
38 stars 4 forks source link

Argb interpolation to toInt() inaccurate #30

Closed Disar closed 7 years ago

Disar commented 7 years ago

I have the following

safeColor.interpolate(dangerColor,game.nextLineTimer/game.nextLineThreshold).toInt();

safeColor = white. dangerColor = red.

The delta input goes from 0 to 1. My object doesn't change color up until 0.5 and just goes full red.

I've traced the output of the interpolation without the toInt() and it seems to output proper values, the toInt however is just -1 and over 0.5' flips to -65536.