Class for handling color selection library

Method Description Available from version
new BX.ColorPicker(
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.
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.
Closes color selection dialog.
Returns link to object BX.PopupWindow.

© «Bitrix24», 2001-2024