How to use tui-color-picker - 2 common examples

To help you get started, we’ve selected a few tui-color-picker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nhn / tui.editor / src / js / extensions / colorSyntax.js View on Github external
const {$el: $button} = toolbar.getItem(colorSyntaxButtonIndex);

  const $colorPickerContainer = $('<div>');

  const $buttonBar = $(`<button class="te-apply-button" type="button">${i18n.get('OK')}</button>`);

  const cpOptions = {
    container: $colorPickerContainer[0],
    usageStatistics
  };

  if (preset) {
    cpOptions.preset = preset;
  }

  const colorPicker = ColorPicker.create(cpOptions);

  let selectedColor = colorPicker.getColor();

  $colorPickerContainer.append($buttonBar);

  const popup = editor.getUI().createPopup({
    header: false,
    title: false,
    content: $colorPickerContainer,
    className: 'tui-popup-color',
    $target: editor.getUI().getToolbar().$el,
    css: {
      'width': 'auto',
      'position': 'absolute'
    }
  });</div>
github nhn / tui.image-editor / src / js / ui / tools / colorpicker.js View on Github external
constructor(colorpickerElement, defaultColor = '#7e7e7e', toggleDirection = 'up') {
        const title = colorpickerElement.getAttribute('title');

        this._show = false;

        this._colorpickerElement = colorpickerElement;
        this._toggleDirection = toggleDirection;
        this._makePickerButtonElement(colorpickerElement, defaultColor);
        this._makePickerLayerElement(colorpickerElement, title);
        this._color = defaultColor;
        this.picker = tuiColorPicker.create({
            container: this.pickerElement,
            preset: PICKER_COLOR,
            color: defaultColor
        });

        this._addEvent(colorpickerElement);
    }

tui-color-picker

TOAST UI Components: Color Picker

MIT
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis

Popular tui-color-picker functions