[wp-trac] [WordPress Trac] #27469: Color picker palette can't be customized

WordPress Trac noreply at wordpress.org
Thu Mar 20 23:37:20 UTC 2014


#27469: Color picker palette can't be customized
-------------------------+-----------------------------
 Reporter:  GregLone     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Appearance   |    Version:  3.5
 Severity:  normal       |   Keywords:
  Focuses:  javascript   |
-------------------------+-----------------------------
 Hello.

 Under the color picker we have a palette with up to 6 colors (or 8?).
 Regarding iris, the option "palettes" can be a boolean, or, if we want
 custom colors, it must be an array.

 In wp-admin/js/color-picker.js L27 we have `$.extend( self.options,
 el.data() );`.
 The problem is:
 - if we pass a string, iris won't use it.
 - if we pass an array, $.extend() will change it into a string.

 My solution is allowing us to pass a comma separated list of colors and
 `split()`. See the diff file.

 Side note: add the width to the available options could be useful
 sometimes, I guess.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27469>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list