Color PickerADDONBootstrap Colorpicker is a modular color picker plugin for Bootstrap

About

A nifty plugin that lets you select colors on the fly. The color pallet is auto generated or can be configured manually. The selection tool is loaded inside bootstrap's popover component, allowing you to load it from any direction, even on bootstrap modals

Find in-depth, guidelines, tutorials and more on Bootstrap Colorpicker's Official Documentation

Simple usage

Most simple example, with any options or color information.

Setting initial color

The initial color can be specified in 3 ways: input value, data-colorattribute and programmatically with the colorconstructor option.
This demo is also showing how to use the input addon component to display the color.

The used initial color has this precedence order when present and not empty: coloroption, input value, input data-colorattribute, colopicker element data-colorattribute.

Automatic format detection

Whenever the formatoption is 'auto', the first parsed color format will be detected and used as default, but when the option equals null(default), the format is recalculated every time. You can see the differences here, one of them allowing you to adjust the alpha channel:

Force format

If defined, the format option forces an specific format, ignoring the original one.

Disabled / Enabled states

When the input is disabled, the colorpicker also gets disabled.

Horizontal mode

In this mode the hue and alpha bars are horizontal instead of vertical.

Disable alpha channel

When the alpha channel is disabled with the useAlphaoption, the alpha bar will be hidden and the color object will be restricted to opaque (alpha = 1).

Add complementary color swatches

The colorpicker ColorItem class uses and comes bundled with Qix Color, a great color parsing library with a friendly API that allows you to manipulate and convert the color. ColorItem is just an abstraction layer on top of the library, which is more convenient for Bootstrap Colorpicker. In this example we use the ColorItem API to add color swatches based on a tetrad of the selected color

Inline containerized mode

In this mode the colorpicker widget is an inline element and it is also placed inside the element (otherwise it is placed in the body). This example also shows the two ways of using the container option.
Inner inline →

Sibling inline →

Disable hexadecimal hash

This example shows how to avoid the input to have the hexadecimal hash prefix, using the useHashPrefix option

Transparent Support

Example showing the transparentnamed color support

Use a custom fallback color

Use a predefined fallback color with the fallbackColoroption, whenever the given one is invalid

Panel Title

Panel tag code
Text

Disable invalid color auto replacement

By default, the autoInputFallbackoption is enabled, meaning that whenever there is an invalid color typed in the input, it will be automatically replaced by a valid color or the fallback one

Adjust popover options

You can use any Bootstrap Popover options (except: trigger, content and html) using the "popover" property in the colorpicker options

Modal Example

You can use any Bootstrap Popover options (except: trigger, content and html) using the "popover" property in the colorpicker options

Customize template

You can use any Bootstrap Popover options (except: trigger, content and html) using the "popover" property in the colorpicker options