@peculiar/color
Version:
Library for color manipulation and conversion in JavaScript.
14 lines • 393 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.rgbToHex = void 0;
/**
* RGB color to HEX color.
* @example
* rgbToHex(255, 255, 255) // =>
*/
function rgbToHex(r, g, b) {
return [r, g, b]
.map(function (value) { return value.toString(16).padStart(2, '0'); }).join('');
}
exports.rgbToHex = rgbToHex;
//# sourceMappingURL=rgb_to_hex.js.map