I’m trying to get a colorized slider at the current position of the dragger to get the result on the attached screenshot.
I followed this link:
https://refreshless.com/nouislider/examples/#section-colorpicker
But I’m still not able to get the correct results. I tried the following:
const [percentage, setPercentage] = useState(0);
const sliderBackground = {
background: `linear-gradient(to right, black ${percentage}%, white ${100 - percentage}%)`
}
<Nouislider
start={value}
range={range}
tooltips={false}
format={format}
onSlide={onChangeSlide.bind(this)}
style={sliderBackground}
keyboardSupport={keyboardSupport}
onChange={(value) => console.log(value)}
/>
Does the NoUI slider have any build-in property for this (based on the docs https://refreshless.com/nouislider/more/#section-styling) or how can I achieve colorized slider at the current position of the dragger?