jQuery colorpicker as slider with grey color range
I want to build a javascript
function on my w开发者_高级运维ebsite to switch the text color within a grey scale of colors. I've searched on google but found nothing as I wanted it. What do I go about creating the range (probably calculated from a start
and end
values) and reading the user input's on a slider to know what to do?
Cheers!
I didn't find any ready-made solutions, but you can use the Slider control from jQueryI UI to create a one-dimensional color picker. I put together a quick jsfiddle to demonstrate. When the user moves the slider, the "slide" event fires and my function changes the background color of a div. You can change the styling of the slider and the #color div to suit your needs.
精彩评论