I ran into an issue with the formatters showing an incorrect color only when opacity was being recorded on the field. Whenever I had a color field with opacity being recorded, the color swatch that got rendered was a completely different color than the one I selected. I don't really know why this was only an issue when opacity was being recorded, but I solved it anyhow.
The issue also affected other formatters (all of them). I tracked it down to the color_field_hex2rgb() function, which somehow was not taking the "#" of the hex value into account (it was not expecting # to be in the string). It was expecting only 6 integers in the string, but was getting 7. I adjusted the hexdec(substr() calls accordingly.
I assume somewhere along the line # started being included in the RGB values, and this function just needed to be updated accordingly.
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
#11 | Screen Shot 2015-09-29 at 20.45.13.png | 131.92 KB | targoo |
#2 | color-field-hex2rgba-2469167-9811101.patch | 525 bytes | caspervoogt |
Comments
Comment #1
caspervoogt CreditAttribution: caspervoogt commentedComment #2
caspervoogt CreditAttribution: caspervoogt commentedComment #3
caspervoogt CreditAttribution: caspervoogt commentedComment #4
caspervoogt CreditAttribution: caspervoogt commentedComment #5
sdstyles CreditAttribution: sdstyles at FFW commentedI had same issue, this patch fixed it. Thanks.
Comment #6
caspervoogt CreditAttribution: caspervoogt commentedglad to hear it
Comment #7
caspervoogt CreditAttribution: caspervoogt commentedso is this RTBC / is it in the dev branch now?
Comment #9
targoo CreditAttribution: targoo commentedHi,
Thanks. It's now been merge to the dev branch.
David.
Comment #10
caspervoogt CreditAttribution: caspervoogt at Plethora commentedrequesting credit for this patch - not sure how to go about that. Getting used to this new contribution/credit setup. Somehow on my organization page it just shows "Contributed to fixing 1 issue in the past 3 months" when it should be 2 or 3 items.
Comment #11
targoo CreditAttribution: targoo commentedtrying to give you also the credit..
Comment #12
caspervoogt CreditAttribution: caspervoogt at Plethora commentedcool - thanks! That worked