MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / componentToHex

Function componentToHex

ui/media/js/image-editor.js:840–843  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

838
839function rgbToHex(rgb) {
840 function componentToHex(c) {
841 var hex = parseInt(c).toString(16)
842 return hex.length == 1 ? "0" + hex : hex
843 }
844 return "#" + componentToHex(rgb.r) + componentToHex(rgb.g) + componentToHex(rgb.b)
845}
846

Callers 1

rgbToHexFunction · 0.85

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected