MCPcopy Index your code
hub / github.com/CreateJS/TweenJS / parseHex

Function parseHex

src/tweenjs/plugins/ColorPlugin.js:196–210  ·  view source on GitHub ↗
(value, mode)

Source from the content-addressed store, hash-verified

194 };
195
196 function parseHex(value, mode) {
197 var o=[0,0,0,1], result = s.HEX_RE.exec(value);
198 if (!result) { return o;}
199 var hex = result[1];
200 if (hex.length === 3) { hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2]; }
201
202 var num = parseInt(hex, 16);
203 o[0] = num>>16;
204 o[1] = num>>8&0xFF;
205 o[2] = num&0xFF;
206
207 if (mode !== "rgb") { rgbToHsl(o); }
208
209 return o;
210 };
211
212 function rgbToHsl(o) {
213 var r=o[0], g=o[1], b=o[2], m = 1/255;

Callers 1

getColorObjFunction · 0.85

Calls 1

rgbToHslFunction · 0.85

Tested by

no test coverage detected