To extend the functionality of Bootstrap Colorpicker, there is something called Bootstrap Colorpicker Extensions.
The library comes with many core extensions like: preview (enabled by default),
debugger, swatches and palette (used by swatches to resolve named colors), but
you can also create your own using the
$.colorpicker.Extension class and adding it globally to the
Colorpicker.extensions
static property or to your instance using
myColorpicker.registerExtension(MyExtensionClass, extensionOptions)
.
Think of an extension as a plugin for Bootstrap Colorpicker, capable of listen and react to all of its events in
a single place, as well as being able to resolve colors (like the swatches extension does).
Color Swatches
This example shows how use the swatches extension to define a list of preset color swatches (or color palette) and use their aliases as input values. W3C named colors are also supported.
Debug Mode
When the debug option is enabled, the builtin debugger extension
will be loaded.
On debug mode, every event is logged (as debug/verbose level) in the browser console.
You can also intercept those logs with the 'colorpickerDebug' event, as shown
in this example.
This example also shows how the events are triggered and when.