Throw an WebColorException if wrong # of hex chars

This commit is contained in:
Zach Copley 2009-06-15 21:21:33 -07:00
parent 2c7f0534ca
commit e7e3709ae0
1 changed files with 2 additions and 1 deletions

View 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);