UNPKG

covertrbgtohex

Version:

this library covert RBG to HEX

12 lines (9 loc) 212 B
const covert = (...num) => { const a = num.map(value => { const hex = value.toString(16); return hex.length === 1 ? "0" + hex : hex; }) return '#' + a.join(''); } export default covert // test