@antv/g2plot
Version:
G2 Plot, a market of plots built with the Grammar of Graphics'
25 lines • 636 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function rgb2arr(str) {
var arr = [];
arr.push(parseInt(str.substr(1, 2), 16));
arr.push(parseInt(str.substr(3, 2), 16));
arr.push(parseInt(str.substr(5, 2), 16));
return arr;
}
exports.rgb2arr = rgb2arr;
function toHex(value) {
var v;
v = Math.round(value);
v = v.toString(16);
if (v.length === 1) {
v = "0" + value;
}
return v;
}
exports.toHex = toHex;
function arr2rgb(arr) {
return "#" + (toHex(arr[0]) + toHex(arr[1]) + toHex(arr[2]));
}
exports.arr2rgb = arr2rgb;
//# sourceMappingURL=color.js.map