canvas transformations | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

canvas transformations

how do you add the color in the text?

31st Aug 2018, 8:09 AM
Mutegeki Brian
Mutegeki Brian - avatar
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
31st Aug 2018, 8:23 AM
šŸŒ“Vincent BergeršŸŒ“
šŸŒ“Vincent BergeršŸŒ“ - avatar
+ 1
If you want to have a coloured text in a canvas: canvas.fillStyle="#ffff00"; canvas.fillText("your text", 10, 10)
31st Aug 2018, 8:22 AM
ThƩophile
ThƩophile - avatar
0
i got the answer. Thanks !!
31st Aug 2018, 8:23 AM
Mutegeki Brian
Mutegeki Brian - avatar