Files
30-seconds-of-code/test/RGBToHex/RGBToHex.js
2018-08-02 13:49:33 +03:00

3 lines
115 B
JavaScript

const RGBToHex = (r, g, b) => ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
module.exports = RGBToHex;