We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 682ac82 commit 518399eCopy full SHA for 518399e
public/js/lib/models/arrow.js
@@ -43,6 +43,8 @@ if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {};
43
@returns {Array}
44
**/
45
hexToRGB: function (h) {
46
+ if ( typeof h !== 'string' || !h.match(/^#([0-9A-F]{3}$)|([0-9A-F]{6}$)/i) ) return [0, 0, 0];
47
+ else if ( h.match(/^(#[0-9a-f]{3})$/i) ) h = '#' + h[1] + h[1] + h[2] + h[2] + h[3] + h[3];
48
var rgb = [],
49
i = 1;
50
0 commit comments