spectrum icon indicating copy to clipboard operation
spectrum copied to clipboard

A way to set global options, then override?

Open sburkett opened this issue 8 years ago • 0 comments

Kind of self-explanatory, but I was looking for a way do something like this:

$(".color-picker").spectrum({
    allowEmpty: false,
    showInput: true,
    containerClassName: "full-spectrum",
    showInitial: true,
    etc....
});

And then provide the current color in separate calls:

  $("#color_widget_background").spectrum({
    color: '#ff0000',
  });

  $("#color_widget_background").spectrum({
    color: '#a0a0a0',
  });

I have like a dozen color pickers on one config page and I'd rather not duplicate the palette and other options a dozen times lol. Any ideas? The above basically overwrites the spectrum options with the defaults. Thanks for any guidance!

sburkett avatar Jun 21 '17 12:06 sburkett