27.09.2017, 07:15
With what exact values did you call the function (especially how much time)?
If I do a simple calculation (like 1250 ms passed of a 5000 ms fade) it outputs the correct color:
255 - (1250 / 5000 * 255) = 191.25 (rounded 191 = 0xBF)
0xFF33CC00 + 0xBF = 0xFF33CCBF which is 25% faded - which is correct.
So either you don't update the textdraw (re-show it after setting the color!) or time doesn't hold the correct value. Or something else I didn't see. Could you post your updated code if the bug still persists?
If I do a simple calculation (like 1250 ms passed of a 5000 ms fade) it outputs the correct color:
255 - (1250 / 5000 * 255) = 191.25 (rounded 191 = 0xBF)
0xFF33CC00 + 0xBF = 0xFF33CCBF which is 25% faded - which is correct.
So either you don't update the textdraw (re-show it after setting the color!) or time doesn't hold the correct value. Or something else I didn't see. Could you post your updated code if the bug still persists?