How to set opacity of a text canvas using Fabric.js ?
In this article, we are going to see how to set the opacity of a canvas-like text using FabricJS. The canvas means text written is movable, rotatable, resizable and can be stretched. Further, the text itself cannot be edited like a textbox.
fabric.Text(text, opacity: number);
Parameters: This function accepts two parameters as mentioned above and described below:
- text: It specifies the text to be written.
- opacity: It specifies the opacity of our text.
Program: We can use FabricJS to set the opacity of a canvas-like text so that it is faded to half of it’s opacity as given below.