Open Jonathancollinet opened 8 years ago
Why is it a dumb question? It's actually a very clever idea, and would be happy to add it.
All right, sorry for the quick edit.
It actually works if we have a range 0-100, and i think we can adjust the value with a simple mathematics calcul like cross multiplication.
I re-update the first comment.
Hi,
It will be great if we can update colors of range with a new attribute colors like:
<section data-range-slider="range" class="range-slider" data-colors="colors" step="1" ng-model="range" min="0" max="100"></section>
where colors = [ color1, color2, color3 ]
It actually work if you add the new attribute and add ng-style on second input range:
ng-style="{\'background\': \'linear-gradient(to right, \'+ _colors[0] +\' 0%, \'+ _colors[0] +\' \' + _model[0] + \'%, \'+ _colors[1] +\' \' + _model[0] + \'%, \'+ _colors[1] +\' \' + _model[1] + \'%, \'+ _colors[2] +\' \' + _model[1] + \'%)\'}"
And the result is:
I don't think that is the best way to do this, but you've got the idea.