Documentation

BX.ColorPicker

Class for handling color selection library

Method Description Available from version
new BX.ColorPicker(
   [options]
)
Creates an object class BX.ColorPicker. Parameters:
  • options {Object} Set of color selection dialog options. All settings are optional.
    • bindElement {Element} - DOM element with dialog displayed near it.
    • onColorSelected {Function} - Function for color selection. Accepts two arguments: selected color and link to dialog.
    • popupOptions {Object} - Sets of options for BX.PopupWindow.
    • selectedColor {String} - Selected color in the color palette.
    • defaultColor {String} - Default color.
    • allowCustomColor {Boolean} - Allow user to manually enter color code. True by default.
    • colorPreview {Boolean} - Show color preview. True by default.
    • colors {Array[]} - Arbitrary list of colors. Each element of colors array is an array with list of colors and corresponding to a specific palette row.
picker.open(
   [options]
)
Shows dialog for color selection on a page. Set of options corresponds to similar settings in BX.ColorPicker, except the key popupOptions. Call with options may be needed, when a single dialog instance is used for several elements on a page.
picker.close()
Closes color selection dialog.
picker.getPopupWindow()
Returns link to object BX.PopupWindow.


© «Bitrix24», 2001-2024
Up