标签: string html5 colors canvas
如何在画布中为文本添加颜色。当我尝试fillStyle时,文字只是保持黑色。
答案 0 :(得分:1)
你确实必须设置fillStyle,然后调用fill();
ctx.strokeStyle = 'red'; ctx.stroke(); ctx.fillStyle= 'blue'; ctx.fill();