Reputation: 101
I'm creating a GUI that has a double
slidePos from 0-1 that needs to dictate the color of a setting. The resulting color should always be at full saturation and 50% brightness. I need to convert the number from 0 to 1 into any color(i.e. three ints), where 0 is red, 0.333 is green, and 0.666 is blue. I would also need the reverse operation, taking three integers and turning them into a double from 0-1. How would I go about the math to make this work?
Upvotes: 1
Views: 833