MCPcopy Create free account
hub / github.com/codecombat/codecombat / hexToR

Function hexToR

app/core/utils.js:589–589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587const hexToHSL = hex => rgbToHsl(hexToR(hex), hexToG(hex), hexToB(hex))
588
589var hexToR = h => parseInt((cutHex(h)).substring(0, 2), 16)
590var hexToG = h => parseInt((cutHex(h)).substring(2, 4), 16)
591var hexToB = h => parseInt((cutHex(h)).substring(4, 6), 16)
592var cutHex = function (h) { if (h.charAt(0) === '#') { return h.substring(1, 7) } else { return h } }

Callers 1

hexToHSLFunction · 0.85

Calls 1

cutHexFunction · 0.85

Tested by

no test coverage detected