I took a crack at this, patch attached.
This might be useful to others who use gradient opacity along with gradient coloring in their themes and wants them to also be adjustable through the color module.
Not being a color expert I don't know if there is more complicated algorithms needed to incorporate gradient opacity when shifting colors so keep that in mind. I took the simple approach of just converting the color portion of css rgba to css hex notation, then letting the color module do its normal shifting on that number, and then incorporating the resultant css hex value back into the css rgba string.
Comment | File | Size | Author |
---|---|---|---|
#5 | color-support_rgba-1392528-5-7.x-do-not-test.patch | 2.66 KB | RunePhilosof |
#4 | color-support_rgba-1392528-4.patch | 2.77 KB | RunePhilosof |
color.module-include-rgba.patch | 2.62 KB | Reg | |
Comments
Comment #1
Reg CreditAttribution: Reg commentedJust found out that things are being done in Drupal 8.x and then getting back ported now.
Comment #2
joachim CreditAttribution: joachim commentedI'm not quite sure what this does -- does it allow opacity to be controlled in the UI, or just preserve it if themes set it in their colour options?
A few code style points below:
Needs a full stop; parameters and return should be described.
Funny whitespace here.
14 days to next Drupal core point release.
Comment #3
Reg CreditAttribution: Reg commentedLooks like I got a tab in there where there should have been a space, just remove it. I can't really rebuild the patch because I have other changes in the module now so the resultant patch wouldn't make sense.
What the code does is allow the color module to make shifts on CSS like this:
As you can see with gradients that have opacity as well you have this "rgba" format for the color. With this extra bit of code the module will shift that as well as the standard "#012345" format for representing color.
Comment #4
RunePhilosof CreditAttribution: RunePhilosof commentedFixed some errors in the regex and made a diff against 8.x.
Also added some comments.
Comment #5
RunePhilosof CreditAttribution: RunePhilosof commentedA port for Drupal 7.x.
Comment #6
markhalliwell#4: color-support_rgba-1392528-4.patch queued for re-testing.
Comment #7
markhalliwellIf we're going to do this, I (personally) would like a way to support also changing the opacity. I could be persuaded either way on this.
Comment #8
_12345678912345678 CreditAttribution: _12345678912345678 commented#4: color-support_rgba-1392528-4.patch queued for re-testing.
Comment #9
_12345678912345678 CreditAttribution: _12345678912345678 commentedRetested and it passed :)
Comment #10
Jeff Burnz CreditAttribution: Jeff Burnz commentedOh good lord, if this gets in I'll be a kid in a lolly shop, really, fantastic.
Comment #11
Reg CreditAttribution: Reg commentedGuys, I'm not sure if it's worth working on this. We could probably depreciate this thread because I put this patch along with a few others I made to the color module all into one patch which other people have been keeping up to date for D8. The combined patch is over here: https://drupal.org/node/1763040 .
Sorry for the upset, I should have notice earlier.
Comment #12
mgiffordI think we should move this to #1763040: Accumulative patch of fixes and enhancements.