Spectrum

bgrins.github.io ↗

Add a jQuery colour control with palettes, transparency and saved choices.

SI Score
80/100
Pricing
Open Source AI reading, not confirmed
Free plan
Not confirmed
Sign-up required
Not confirmed

Ask SI about Spectrum

Answers use saved listing facts and recorded sources.
Homepage screenshot
Screenshot of the Spectrum homepage

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