For example I want to use RGB values in the colors array, basic reason is so I can tweak these in color.css with RGBa and create a more cooler colored themes :)
Problem - while this does work, you cannot create a custom color scheme - this looks, initially, like a failing of Farbtastic, if this is so then we need to get rid of Farbtastic and use something that will use RGB, because RGB is the way of the future (RGBa is just to useful to ignore and not support).
Additionally I have tried simply using the RGB equivalent in colors.css, this works for the default color scheme but again you can't customize it, or even any other scheme, the hex to rgb conversion breaks down somewhere.
If I'm doing something wrong then please advise, I'd really really love to use RGB in color module.
Here's a sample of my scheme:
'schemes' => array(
'default' => array(
'title' => t('Winter'),
'colors' => array(
'base' => '255,255,255',
'link' => '5,118,229',
'top' => '244,244,244',
'bottom' => '251,251,251',
Basically what happens is the RGB values show up in the color picker fields, but you cannot change them, them, and the color does not actually show, the field is white with the RGB value (text) only. Please see the screenshot of farbtastic and the color form failing badly.
Comment | File | Size | Author |
---|---|---|---|
farbtastic-rgb.png | 27.94 KB | Jeff Burnz |
Comments
Comment #1
Jeff Burnz CreditAttribution: Jeff Burnz commentedFixing typo in title, ops...
Comment #2
Jeff Burnz CreditAttribution: Jeff Burnz commentedIn further testing color module can't work with HSL either - this is rather odd because afaict Farbtastic can support hsl and has functions for converting all three (hex, rgb, hsl). I am no js expert but from what I can tell its color.sj that is the problem, I am not sure.
I am changing this to a feature request against D8, I really think we should be able to use RGB or HSL as this will open up a world of sophisticated CSS3 designs we never thought possible with color module.
Comment #3
wjaspers CreditAttribution: wjaspers commentedDoes this issue specifically pertain to "Farbtastic"?
If not,
Why doesn't Drupal adopt something like JSColor? (http://jscolor.com/try.php)
It includes Hex/RGB/HSL, can function with AJAX as needed, and supports empty values.
Otherwise, there is a jQuery based picker, too:
http://www.eyecon.ro/colorpicker/
Comment #4
mfer CreditAttribution: mfer commented@wjaspers Farbtastic is the current color picker. Nothing here is farbtastic specific.
@Jeff Burnz What is is you want to happen here? The code just needs to be updated to work to the need. Is it you want to switch from hex to rgb? Something else?
Comment #5
dcrocks CreditAttribution: dcrocks commentedActually farbtastic does use hsl. There is some code in color.module converting hex colors to rgb to hsl and back. I think the issue is specifying rgb or hsl colors in css and passing those to the color.module, which currently only accepts hex colors. color.module has an interesting comment on line 278:
// Only accept hexadecimal CSS color strings to avoid XSS upon use.
Comment #6
tim.plunkettMarked #1129698: Allow Transparent or Inherit in color palette as a duplicate, I think this is a better place to discuss expanding Color module.
Comment #7
markhalliwellI think we can still get this in though. Postponed on #481682: Decide what to do with Farbtastic library though.
Comment #8
inders CreditAttribution: inders commentedSeems like some work is being done @ https://drupal.org/node/1392528.
Comment #9
markhalliwellHm, that seems to be dealing with just RGBA (with alpha), not HSL like this issue. Also moving to 9.x since this is a feature request.
Comment #10
mgiffordI think we should move this to #1763040: Accumulative patch of fixes and enhancements.
Comment #11
mitokens CreditAttribution: mitokens as a volunteer commented