I've done quite a bit of work on the color module which resulted in several issues so I'm adding a patch here with all the fixes and enhancements.

next steps:

  • decide if those other issues should be closed in favor of this on.
  • list all those issues here in the summary and as related issues (the [#NNNNNN] pattern we can use in our issue queue is nice for linking issues in text)
  • issue summary update (instructions: https://drupal.org/contributor-tasks/write-issue-summary)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Reg’s picture

Version: 7.15 » 8.x-dev
FileSize
3.16 KB

This patch does the following:

The patch is against 7.15 but since we're doing everything in 8 and then back porting I changed the version to 8.

Reg’s picture

Forgot to include the change to a regex on the previous patch.

Reg’s picture

An improvement to the regex. In the rare case that someone has decimal point in the opacity will still work.

markhalliwell’s picture

Status: Active » Needs review

At quick glance this looks promising and pretty straight forward. I will take a deeper look into this patch further when I have the time. Could you re-roll this against D8 core though? You changed the version but never actually posted a viable D8 patch.

I've done quite a bit of work on the color module which resulted in several issues

Are these issues on d.o or are you just referring to your daily use with the module? If they are, could you reference them here. Thanks!

+++ b/modules/color/color.module
@@ -767,0 +797,43 @@
+  preg_match($re,	$rgba, $rgb);
...
+  preg_match($re,	$rgba, $a);

Also, remove these tabbed spaces (ie: between $re, and $rgba).

markhalliwell’s picture

Status: Needs review » Needs work

Sigh, wrong status lol Didn't mean to trigger tests.

markhalliwell’s picture

Issue tags: +Needs reroll

tagging

brockfanning’s picture

Assigned: Unassigned » brockfanning
brockfanning’s picture

Assigned: brockfanning » Unassigned

Bit off more than can chew, currently, but I may grab this again if things calm down at work.

Albert Volkman’s picture

Status: Needs work » Needs review
FileSize
3.69 KB

Re-roll of #3 for D8.

Also applied @Mark Carver's suggestion from #4.

tim.plunkett’s picture

Issue tags: -Needs reroll

#9: color-module-1763040-9.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Needs reroll

The last submitted patch, color-module-1763040-9.patch, failed testing.

Albert Volkman’s picture

Status: Needs work » Needs review
FileSize
3.71 KB

Re-roll.

star-szr’s picture

Issue tags: -Needs reroll

Thanks @Albert Volkman, removing reroll tag.

star-szr’s picture

Issue summary: View changes

Fixed typo.

YesCT’s picture

Issue summary: View changes

My guess is that we are better off with the separate issues, any reason not to put these things back into those issues?

Reg’s picture

It's been so long since I created this that I don't remember the specifics but from memory the pieces all relate tight enough that it's probably worth leaving it as one patch here and just calling it a color shifting enhancement patch or something like that.

mgifford’s picture

Needed a reroll.

jhedstrom’s picture

Patch still applies with offset. The summary should be updated to clarify what this accomplishes.

joachim’s picture

Status: Needs review » Needs work

Patch has code formatting and documentation problems.

Also, yes, the issue summary should say what this patch is actually doing. What are these new conversion functions for?

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

alexej_d’s picture

How come this issue is dead for 2 years already? Why not review it or close the issue?

cilefen’s picture

It's been reviewed. People seemed to like it but it needs an issue summary update.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andypost’s picture

Version: 8.6.x-dev » 8.8.x-dev
HOG’s picture

Issue summary: View changes
FileSize
224.68 KB
249.21 KB

After apply this patch: https://www.drupal.org/project/drupal/issues/1763040#comment-8882561
I see 2 issues.
1. Can't save the form with rgba values:

2. Drupal return colors object with an array in first item:

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

kostyashupenko’s picture

Bump.

It's almost a middle of 2022th year already. We need HSL format colours and we need even more...
I just installed a fresh Drupal 9.3.9 with standard profile installation and i still see these features are not implemented, so sad(

I'm thinking about smth like "Settings" link of the Color module on this page `/admin/modules`, and by clicking on it you are redirecting to its settings page.

Settings page contains information like "How do you want to declare and store colours on your web-site?" and several options below, like:
1. hex
2. rgb(r, g, b)
3. r, g, b
4. hsl(h, s, l)
5. h, s, l

Something like this. I also thinking about 5th point here, it would be really nice to store colours like these (namings of course are just for example):

--color-blue-source: 240, 100%, 50%; <-- we let color module to modify only this variable
--color-blue: hsl(var(--color-blue-source));
--color-blue-70: hsla(var(--color-blue-source), 0.7);
--color-blue-50: hsla(var(--color-blue-source), 0.5);
...and so on

So in that case we can let user configure only --color-blue-source, and the rest of colours (even colors including alpha channel) will be automatically updated.

By the way, please let me know how do you handle color palettes on your real projects right now? How do you override colors of theme's palette?

andypost’s picture

ravi.shankar’s picture

FileSize
3.79 KB
2.47 KB

Added reroll of patch #16 on Drupal 9.4.x.

mherchel’s picture

Drupal ate my previous comment 😭

Anyway, the Olivero theme generates its palette by adjusting the luminosity in the HSL colors. So, this functionality is important. As far as client projects, it really depends on the needs.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

This work doesn't look like it should be a child of #3270894: [Meta] Tasks to deprecate Color (which was just committed), therefore removing the parent.

quietone’s picture

Project: Drupal core » Color backport
Version: 9.5.x-dev » 2.x-dev
Component: color.module » Code

Color has been removed from core, #3270899: Remove Color module from core.

ravi.shankar’s picture

FileSize
3.71 KB
377 bytes

Added a patch #36 on color module.