Click here to Skip to main content
15,884,975 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all
in HSl the saturtion value is float and its range between 0 and 1
is there range of saturation take int numbers and what is this range?
how can i convert from int value to double value?
Posted

1 solution

My first reaction would be: Why not simply use a float between 0 and 1?

But if you want to work with integers you can easily do so. You just need to set an upper and lower bound for the range you use. Let's take a range of 0 to 255. Converting it to a valid saturation would be simply dividing the value by 255. (don't forget to check for zero values)

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900