Simon54 Posted September 9 Share Posted September 9 Hello, I ran into a little problem while interpolating between GREEN and RED. When the time value reached '500' it was suppose to start from GREEN and fade into RED until the time value reached '600'. Problem is, it does not start at full GREEN because the time value is already '500' at the point in the function. I tried a bunch of math calculations to fix this but can't seem to figure it out. I'd appreciate any sort of help. if (time >= 500 and time < 600) then -- local progress = (time/600) local progress = (time/100) -- time value at this point is '500' selection_color = tocolor(interpolateBetween( 0, 255, 0, 255, 0, 0, progress, "Linear")) end Link to comment
Shady1 Posted September 9 Share Posted September 9 if (time >= 500 and time < 600) then local progress = (time - 500) / 100 -- Normalize progress between 0 and 1 selection_color = tocolor(interpolateBetween( 0, 255, 0, 255, 0, 0, progress, "Linear")) end 1 Link to comment
Simon54 Posted September 9 Author Share Posted September 9 Ohh okay okay I see now. local progress = (time - 500) / 100 -- Normalize progress between 0 and 1 Thank you man, I appreciate Link to comment
Shady1 Posted September 9 Share Posted September 9 8 minutes ago, Simon54 said: Ohh okay okay I see now. local progress = (time - 500) / 100 -- Normalize progress between 0 and 1 Thank you man, I appreciate You're welcome. If you have any problems, please let me know. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now