bgrins / spectrum

The No Hassle JavaScript Colorpicker
https://bgrins.github.io/spectrum/
MIT License
2.32k stars 588 forks source link

New option: color shown as input background in colorpicker #519

Closed geekbrit closed 6 years ago

geekbrit commented 6 years ago

I was looking for a way to preview the selected color in a flat colorpicker. Using the background of the text input gives a nice area for the preview without increasing the colorpicker footprint. I included an "isDark" test function to ensure that a contrasting text color is used.

geekbrit commented 6 years ago

Have since looked through tinycolor docs... already has isDark, my implementation of the feature isn't optimal.