diff --git a/lib/parsers.js b/lib/parsers.js
index <HASH>..<HASH> 100644
--- a/lib/parsers.js
+++ b/lib/parsers.js
@@ -291,7 +291,7 @@ exports.parseColor = function parseColor(val) {
   if (res) {
     var defaultHex = val.substr(1);
     var hex = val.substr(1);
-    if ([3, 4].indexOf(defaultHex.length) > -1) {
+    if (hex.length === 3 || hex.length === 4) {
       hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
 
       if (defaultHex.length === 4) {
Use explicit comparison to hex length