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

Function hexToB

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

Source from the content-addressed store, hash-verified

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 } }
593
594const hslToHex = hsl => '#' + (Array.from(hslToRgb(...Array.from(hsl || []))).map((n) => toHex(n))).join('')

Callers 1

hexToHSLFunction · 0.85

Calls 1

cutHexFunction · 0.85

Tested by

no test coverage detected