diff --git a/lib/pen.js b/lib/pen.js index 4a8c5fa..c4e803b 100644 --- a/lib/pen.js +++ b/lib/pen.js @@ -34,7 +34,7 @@ export default class Painter { // 如果未设置背景,则默认使用白色 this.ctx.setFillStyle('#fff'); this.ctx.fillRect(-(width / 2), -(height / 2), width, height); - } else if (bg.startsWith('#') || bg.startsWith('rgba')) { + } else if (bg.startsWith('#') || bg.startsWith('rgba') || bg.toLowerCase() === 'transparent') { // 背景填充颜色 this.ctx.setFillStyle(bg); this.ctx.fillRect(-(width / 2), -(height / 2), width, height);