A UI component for picking a color from arbitrary 256 color palettes

This is a simple, flexible color-picker widget. It has no dependencies (not even on jQuery), so it's easy to just plug in and use. It weighs less than 3kb of combined JS & CSS once minified and gzipped.

Since it exposes itself via the UMD exports format, it will comply with whatever module loading system you're using. If you're not using one, it will expose a global called EightBitColorPicker.

Install

You can of course go through the old-school copy/pasta routine, but here's the incantation to pull this in using Bower:

bower install --save eight-bit-color-picker

And for those that prefer component:

component install bilalq/eight-bit-color-picker

Use

<div class="eight-bit-color-picker"></div>
EightBitColorPicker.detect()
And voila:

Customize

This widget is easy to customize and extend.

You can set default colors (these stay blue and green even after a refresh):
Or even change the color palette entirely:

Check out the docs for more details.