[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: web site stats updated



On Thu, Jul 19, 2001 at 11:43:24PM +0200, Josip Rodin wrote:
> Oh and just in case anyone wondered, yes, I also think the color transition
> from red to green should include yellow, like on European traffic lights :o)
> But I haven't gotten to that part yet. Maybe later tonight, if someone
> doesn't patch it sooner (hint, hint :).

Here is a patch which goes from red (to orange) to yellow to
green.  You can see all the colors at
http://opensource.lineo.com/~kraai/foo.html .  OK to commit?

Matt

--- stattrans.pl	Fri Jul 20 08:07:42 2001
+++ /home/kraai/stattrans.pl	Fri Jul 20 08:36:16 2001
@@ -163,10 +163,10 @@
 {
     my $percent = shift;
 
-    if ((255 - ($percent * (255/75))) < 0) {
-	return sprintf ("#%02x%02x00", 255 - ($percent * (255/100)), $percent * (255/100));
+    if ($percent < 50) {
+    	return sprintf ("#FF%02x00", (255/50) * $percent);
     } else {
-	return sprintf ("#%02x%02x00", 255 - ($percent * (255/75)), $percent * (255/100));
+	return sprintf ("#%02xFF00", (255/50) * (100 - $percent));
     }
 }
 



Reply to: