What it does
Spectrum is a JavaScript colour-picker plugin for jQuery. It offers popup or inline picking, typed values, transparency controls and fixed palettes. Developers can also keep recent selections in browser storage. Spectrum's source uses MIT, allowing reuse and modification with its notices preserved.
A brand-settings form can show only approved colours, while an editor can expose the full picker. Load Spectrum’s script and stylesheet, initialise it on an input, then choose the palette, text-input and alpha options needed for that field.
The move event follows the pointer through the picker. change runs when the choice is committed by closing it or pressing Choose. Calling set from code updates the input without firing change, which avoids an event loop.
Recent choices can share a localStorageKey between pickers. Set maxSelectionSize to cap that history; older colours are removed first. The get method returns a colour object with hex, RGB, HSL and HSV output methods. Spectrum’s code is distributed under MIT.
Strengths
- Palette-only controls can optionally reveal the full picker.
- Separate movement and commit events suit live previews and saved settings.
Watch out for
- The plugin requires a jQuery application environment.
- Programmatic set calls do not trigger change callbacks.
Best for
- Developers adding configurable colour fields to existing jQuery interfaces.
Sources
- Spectrum - The No Hassle jQuery Colorpicker (Oct 28, 2026)
- GitHub - bgrins/spectrum: The No Hassle JavaScript Colorpicker · GitHub (Oct 28, 2026)
- spectrum/LICENSE at master · bgrins/spectrum · GitHub (Oct 28, 2026)
