Pick color from a sprite using a slider

Hello I have a sprite something like this

I want to use the sprite as a slider to pick the color.
How would I go about doing this?

Make 4 floats.
Name them each. R, g, b, and a…
Then each of them have a Range attribute, min=0, max=1