How to use vanilla-picker - 4 common examples

To help you get started, we’ve selected a few vanilla-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 formio / formio.js / src / contrib / sketchpad / sketchpad.js View on Github external
attach: (element) => {
          const picker = new Picker(element);
          picker.setColor(this.state.fill, true);
          picker.onChange = (color) => {
            this.state.fill = color.rgbaString;
            element.style.color = color.rgbaString;
          };
          return element;
        }
      },
github WPS / domain-story-modeler / app / domain-story-modeler / features / context-pad / DomainStoryContextPadProvider.js View on Github external
export default function DomainStoryContextPadProvider(injector, connect, translate, elementFactory, create, canvas, contextPad, popupMenu, replaceMenuProvider, commandStack, eventBus, modeling) {

  const picker = new Picker(document.getElementById('pickerAnchor'));
  const pickerOptions = {
    color: 'black',
    popup: 'bottom'
  };
  let selectedID;
  let startConnect;

  picker.setOptions(pickerOptions);
  picker.onDone = function(color) {
    if (selectedID.includes('shape')) {
      const allGroups = getAllGroups();
      const allCanvasObjects = getAllCanvasObjects();

      const isDone=pickerFunction(allCanvasObjects, color);

      if (!isDone) {
github formio / formio.js / src / components / sketchpad / Sketchpad.js View on Github external
attach: (element) => {
          const picker = new Picker(element);
          picker.setColor(this.state.fill, true);
          picker.onChange = (color) => {
            this.state.fill = color.rgbaString;
            element.style.color = color.rgbaString;
          };
          return element;
        }
      },

vanilla-picker

A simple, easy to use vanilla JS color picker with alpha selection.

ISC
Latest version published 8 months ago

Package Health Score

63 / 100
Full package analysis

Popular vanilla-picker functions