Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


#Actualferrous

Posted 27 February 2014 - 04:57 PM

On a more generic level, floating point color values range from 0.0 to 1.0, so all thats required is a simple scaling of the ratios.  To squash anything to be between 0 and 1, just divide by the max value of that other thing.  (There is slightly more work involved if the ranges don't both start at 0.0)


#1ferrous

Posted 27 February 2014 - 04:56 PM

On a more generic level, floating point color values range from 0.0 to 1.0, so all thats required is a simple scaling of the ratios.  To squash anything to be between 0 and 1, just divide by the max value of that other thing.


PARTNERS