Color bar Interpolation
1 reply to this topic
Members - Reputation: 128
Posted 23 July 2014 - 11:25 AM
I have a Colorbar (Row of colors) representing 1000s of color.
The colorbar has two sliders on the top of it. When I move the sliders, I should get the color represented by lower slider and upper slider. I cannot apply Interpolation to get these extremes. because R, G, B components
not moving in linear fashion. In first 1/3rd of colorbar R is increasing, B is decreasing, but G is constant.
next 1/4 th R is increasing, B is constant, G is decreasing and so on.
How can I create mathematical model,so that I can get a exact color values of chosen sliders.
Sorry for my poor English
Crossbones+ - Reputation: 8934
Posted 23 July 2014 - 11:59 AM
Use either of the HSL or HSV color spaces, interpolate in that space, and then convert to RGB when needed.
gzip: H4sIAAAAAAAEAG1QTUvEMBC991e8nvaiFfYoS7yo sLCo6MnjtJ1ugmkiyWRL/72z3T1YEQIJ8z4zA2Xp yPvt1qBpGrRFIJZkk9FyRyUzHCbKIHgn4hnZOrm1 TD0mG0HCCs+QGDGWziKXI6Wm2n++GYwUVH2mrGEE PnGCVQ8K8+JYfXA6URDEQfMZh5h6g5eoAlWJdeEI bbH2qYZf7XMUfw8f/Q0oMeZYNL9/WHF0uFEshvMr XYujd9SycFb+F18QcSOvlJauZ8ejqevdnV7/d550 e0t6prmunh73Bu+vz4c/XUeOQXfJgvKNkhf95U8/ Dtgmy5IBAAA=