+ 1
canvas transformations
how do you add the color in the text?
3 Respostas
+ 2
Hi Mutegeki Brian,
In canvas you use the attributes
txtId.fillText("hello world", 20, 40);
txtId.fillStyle = "red";
to color.
In inline-css:
<tag style="color:red;></tag>
In CSS:
#idOne {
color:red;
}
In additional:
https://www.w3schools.com/tags/canvas_fillstyle.asp
https://www.w3schools.com/tags/canvas_filltext.asp
+ 1
If you want to have a coloured text in a canvas:
canvas.fillStyle="#ffff00";
canvas.fillText("your text", 10, 10)
0
i got the answer. Thanks !!