Ability to define a preset color collection or palette

Created on 1 March 2019, almost 6 years ago
Updated 25 September 2023, about 1 year ago

It would be great feature to have the ability to define a color collection preset. I have numerous color fields on a website all set to "Color Boxes" with a number of Hex values. At the moment all of the color sets are defined in the individual field's "form display" settings. If I wanted to add/remove/modify a color however, I have to update every single color field one by one which is a great pain.

Now it would be great to be able to define pre set color palettes, similar to and "Image Styles" so that they could be used everywhere a color field is created and then it could be set in that field's form settings to use: Color Pallete > My Palette

Thanks for this amazing module.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada puya

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇷France canardesign Montpellier

    Thank you for the tip ! I had to set the palette this way in order to get it to work :
    $element['#attached']['drupalSettings']['color_field']['color_field_widget_box']['settings'][$element['#uid']]['palette'] = $colors;

  • 🇮🇹Italy finex

    Hi, I've created a patch with the following features:

    - Add a settings page to define the colors palette.
    - Add a widget settings to allow entering a custom hex code on the box widget.
    - Load the settings palette colors as default value when the field is configured of if the field settings value is empty.

  • 🇮🇹Italy finex

    Updated patch, the previous had a typo on a couple of filenames.

Production build 0.71.5 2024