Skip to main content

Colorpicker API overview

Methods#

NameDescription
clear()clears the value set in the colorpicker and removes focus
destructor()releases the occupied resources
getCurrentMode()returns the current mode of displaying ColorPicker
getCustomColors()returns an array of selected custom colors
getValue()returns the code of a selected color in the Hex format
paint()repaints ColorPicker on a page
setCurrentMode()shows colopicker either in the "palette" or in the "picker" mode
setCustomColors()sets custom colors that will be displayed at the bottom of the palette
setFocus()sets focus on the specified value
setValue()selects a color in ColorPicker

Events#

NameDescription
applyfires on clicking the "Select" button
cancelClickfires on clicking the "Cancel" button
changefires on changing selected color in ColorPicker
modeChangefires on changing the mode of the colorpicker

Properties#

NameDescription
cssadds custom CSS classes to ColorPicker
customColorsshows a section with custom colors in the bottom part of ColorPicker
grayShadesdefines whether the section with gray shades is displayed in the palette
modespecifies the mode of displaying a colorpicker
palettecontains arrays of colors you want to show in a colorpicker
paletteOnlydefines whether ColorPicker is shown only in the palette mode
pickerOnlydefines whether ColorPicker is shown only in the picker mode
widthsets the width of ColorPicker