]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/webcolor.php
Uppercase hex color values
[quix0rs-gnu-social.git] / lib / webcolor.php
index 65713d26ef7e695821a2faa94c47e9b4ffd54761..f3ca6e94a8bfd4154cc1690339c2cdc1ba8f1443 100644 (file)
@@ -120,7 +120,8 @@ class WebColor {
                                      $hexcolor[1].$hexcolor[1],
                                      $hexcolor[2].$hexcolor[2]);
         } else {
-            return false;
+            $errmsg = _('%s is not a valid color! Use 3 or 6 hex chars.');
+            throw new WebColorException(sprintf($errmsg, $hexcolor));
         }
 
         $this->red   = hexdec($r);
@@ -163,7 +164,7 @@ class WebColor {
         $hexcolor .= (strlen(dechex($this->blue)) < 2 ? '0' : '') .
             dechex($this->blue);
 
-        return $hexcolor;
+        return strtoupper($hexcolor);
 
     }