You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by qu...@apache.org on 2004/02/18 21:51:20 UTC

svn commit: rev 6721 - incubator/spamassassin/trunk/lib/Mail/SpamAssassin

Author: quinlan
Date: Wed Feb 18 12:51:19 2004
New Revision: 6721

Modified:
   incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
Log:
clean up hue sub, add white and black "hues"


Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm	(original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm	Wed Feb 18 12:51:19 2004
@@ -730,26 +730,16 @@
   if ($color =~ /^\#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i) {
     my ($h, $s, $v) = rgb_to_hsv(hex($1), hex($2), hex($3));
     if (!defined $h) {
-      return "gray" unless ($v == 0 || $v == 255);
-    }
-    elsif ($h < 30 || $h >= 330) {
-      return "red";
-    }
-    elsif ($h < 90) {
-      return "yellow";
-    }
-    elsif ($h < 150) {
-      return "green";
-    }
-    elsif ($h < 210) {
-      return "cyan";
-    }
-    elsif ($h < 270) {
-      return "blue";
-    }
-    elsif ($h < 330) {
-      return "magenta";
-    }
+      return "black" if $v == 0;
+      return "white" if $v == 255;
+      return "gray";
+    }
+    return "red" if ($h < 30 || $h >= 330);
+    return "yellow" if $h < 90;
+    return "green" if $h < 150;
+    return "cyan" if $h < 210;
+    return "blue" if $h < 270;
+    return "magenta" if $h < 330;
   }
   return "hue_unknown";
 }