* Mostly based on other plugins and functions (linted and optimized a little).
* Sources cited inline.
*/
-( function ( $ ) {
+( function () {
/**
* @class jQuery.colorUtil
* @singleton
if ( color && Array.isArray( color ) && color.length === 3 ) {
return color;
}
+ if ( typeof color !== 'string' ) {
+ return undefined;
+ }
// Look for rgb(num,num,num)
// eslint-disable-next-line no-cond-assign
}
// Otherwise, we're most likely dealing with a named color
- return $.colorUtil.colors[ $.trim( color ).toLowerCase() ];
+ return $.colorUtil.colors[ color.trim().toLowerCase() ];
},
/**
};
-}( jQuery ) );
+}() );