Ability to define a preset color collection or palette

Created on 1 March 2019, about 6 years ago
Updated 25 September 2023, over 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

Merge Requests

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.

  • Assigned to shivam_tiwari
  • 🇮🇳India shivam_tiwari

    I am working here.

  • Pipeline finished with Failed
    25 days ago
    Total: 890s
    #462354
  • 🇮🇳India shivam_tiwari

    I worked here and checked module functionality according to the description provided of this issue. I checked patch #8, and it is working fine but I was not getting custom color palette created by user on the field settings. Actually, this default colors field is a required field and we added a condition for overriding it if this filed value is empty. When I am going to clear this value for setting custom color palettes it is not working. It is giving me required field error. So I removed required attribute from this.
    Now if we clear existing default values we will get custom color palettes added on the settings page.
    Second, I updated the info file also of the module to visit user to settings page directly.

    For now pipeline is failing so changing issue status to Needs work for fixing pipeline failure.

Production build 0.71.5 2024