I'm using color module v.5.12 and reworking it for a subtheme of zen classic. Everything works smoothly except I came across a couple issues that I hope can be changed for future versions:
In color.inc, you cannot use the gradient multiple times. I came across this because of the way tabs.png sliced the 3 states of tabs for zen classic (vertically). I had to resave the image horizontally so the gradient would show across all 3 states (link, hover, active). What would be nice in the future is of course multiple gradients, or even just using one gradient multiple times. Here's the code that currently doesn't allow this:
color.inc
// Coordinates of gradient (x, y, width, height)
'gradient' => array(21, 96, 1500, 23),
color.module
// Render gradient.
for ($y = 0; $y < $info['gradient'][3]; ++$y) {
$color = _color_blend($target, $palette['top'], $palette['bottom'], $y / ($info['gradient'][3] - 1));
imagefilledrectangle($target, $info['gradient'][0], $info['gradient'][1] + $y, $info['gradient'][0] + $info['gradient'][2], $info['gradient'][1] + $y + 1, $color);
}
Maybe if this was a foreach like the rest?
Secondly, an issue arose when I was using a secondary menu. In zen classic, the secondary menu appears directly underneath the primary menu. I wanted to make the bottom border of primary, bottom border of secondary, and the hover state of secondary links the same color.
I'm able to do this in my default theme because I control the styles. However, when using the color module, my style.css resaves #secondary a:hover background-color to a shift of the link color instead of the color that I input. Here's the result:
/*** style.css ***/
a:link, a:visited
{
color: #6191C5;
}
#primary
{
border-bottom-color: #2763A5;
}
#secondary
{
border-bottom-color: #2763A5;
}
#secondary a:hover
{
background-color: #2763A5;
}
/*** color module created style.css ***/
a:link, a:visited
{
color: #6c410e;
}
#primary
{
border-bottom-color: #d5b048;
}
#secondary
{
border-bottom-color: #d5b048;
}
#secondary a:hover
{
background-color: #46341e;
}
The first set of styles are a range of blues. The second is the "Belgian Chocolate" theme. As you can see, the link #secondary a:hover hexadecimal is based on a:link's color instead of the given hexadecimal. I've attached a screenshot of this discrepancy.
Both of these issues I'm sure can be fixed by hacking core, but that's a no-no here. So fixes for future versions would be great.
| Comment | File | Size | Author |
|---|---|---|---|
| color-shift.jpg | 64.39 KB | suthy |
Comments
Comment #1
tonyn commentedOK. I'm going to look a bit more into this, particularly that zen theme (would be nice if we could get that to color).
Comment #2
tonyn commentedAh, I would liked to add, this module is branched off the 6.x version. (there is no 5.x version).
In this modified 6.x version, we already are handling gradients differently. I am going to still look into these features and these colors.
If I understand you correctly, you may be able to get away with multiple gradients. Let me provide you with the link: http://drupal.org/node/206708
Comment #3
dman commentedA few days ago I ran through a colorizing of zen. It went all good.
color.module has a next generation version that supports multiple gradients and multiple key colors.
It works!
Start with that if you've got ideas to extend!