Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The ability to define a small palette of colors (see attached mockup) for a user to select from would be nice (perhaps in Field Settings). These might be colors that fit a site's color scheme, so that the user does not already need to know the precise hex values for them.
Comment | File | Size | Author |
---|---|---|---|
example_color-picker_ui.png | 31.91 KB | LaurenH |
Comments
Comment #1
emilybennet CreditAttribution: emilybennet commentedThis would be totally cool and highly useful for maintaining a color scheme in user content… :D
Comment #2
plopescHello
How I could include the palette in the jQuery plugin?
I'm reading documentation but I can't find the way to include it.
Thank you
Comment #3
alanom CreditAttribution: alanom commentedEdit: ignore this, I made some assumptions about existing modules. Seems like this feature is pretty rare at the moment. I'm surprised there doesn't seem to be a simple module where you input colours into a text area on defining a field like the option list widget (like
#ff0000|Bright red
seperated by line breaks) then it gives you those options.__________________
For setting the colours, you could look at (or, maybe even consider merging with) modules like colorfield which support choosing colour presets, to have another optional widget with presets using a system like color fields' for inputting presets. Then, assuming this feature doesn't already exist as an option in the jQuery plugin's API, you could add some custom javascript that is used in cases where the widget with presets is being used, that appends HTML elements to the color picker element and binds click events to them.Comment #4
Jaypan CreditAttribution: Jaypan at Jaypan commentedIt's a good idea, but it's outside the scope of what this module was designed to do. If someone wants to supply a patch, I'll be happy to take a look.