After looking into #5131, #5171, and #5172 I'd like to see the (additional) ability to style the tag cloud between two colors - like it is possible with the UTW Plugin (http://www.neato.co.nz/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-help-themes.html#tagcloud).
With the above tickets we have the ability to apply individual classes per tag and ignore the font-size thing, which in theory should be enough for a color-weighted tag-cloud. But with every additional tag one would have to re-define the css-stylesheet - not very Wordpressy.
It would be nice to have additional parameters in the wp_tag_cloud() function for the start- and end-color, and have the function "render" the in-between colors... like wp_tag_cloud('...&startC=#990022&endC=#1166CC');
I guess since the font-size is already calculated in relation to the amount and order of the tag shown, it shouldn't be too hard to tweak the function to do the same for hex-color-codes?
The difficulty is to calculate the right in-between color-codes... I have tried to understand what is done in the appr. function (ultimate-tag-warrior-core.php) in UTW, but frankly, failed to understand it (and the comment at the beginning isn't encouraging either):
/* This is pretty filthy. Doing math in hex is much too weird. It's more likely to work, this way! */
function GetColorForWeight($weight) {
global $maxtagcolour, $mintagcolour;
if ($weight) {
$weight = $weight/100;
$minr = hexdec(substr($mintagcolour, 1, 2));
$ming = hexdec(substr($mintagcolour, 3, 2));
$minb = hexdec(substr($mintagcolour, 5, 2));
$maxr = hexdec(substr($maxtagcolour, 1, 2));
$maxg = hexdec(substr($maxtagcolour, 3, 2));
$maxb = hexdec(substr($maxtagcolour, 5, 2));
$r = dechex(intval((($maxr - $minr) * $weight) + $minr));
$g = dechex(intval((($maxg - $ming) * $weight) + $ming));
$b = dechex(intval((($maxb - $minb) * $weight) + $minb));
if (strlen($r) == 1) $r = "0" . $r;
if (strlen($g) == 1) $g = "0" . $g;
if (strlen($b) == 1) $b = "0" . $b;
return "#$r$g$b";
}
}
What do you think?