/**
 * 产生一个单像素画布
 * @param {*} color 默认颜色
 */
function onePixelCanvas(color = '#000000') {
    var canvas = document.createElement('canvas');
    canvas.width = 1;
    canvas.height = 1;
    var ctx = canvas.getContext('2d');
    ctx.fillStyle = color;
    ctx.fillRect(0, 0, 1, 1);
    return canvas;
}

/**
 * 图片工具类
 */
const ImageUtils = {
    onePixelCanvas: onePixelCanvas
};

export default ImageUtils;