diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-06-15 21:21:33 -0700 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-06-15 21:21:33 -0700 |
commit | e7e3709ae0294b8400b85d87f2ebeade5b31858d (patch) | |
tree | 274c2390c37c463581ec4e7589e046f55ef8a902 | |
parent | 2c7f0534ca26b9c9461d920bb23765b282e6fdbc (diff) |
Throw an WebColorException if wrong # of hex chars
-rw-r--r-- | lib/webcolor.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/webcolor.php b/lib/webcolor.php index 65713d26e..aaf31d990 100644 --- a/lib/webcolor.php +++ b/lib/webcolor.php @@ -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); |