How to change background color of canvas-type text using Fabric.js ?
In this article, we are going to see how to change the background color of the canvas-like text using FabricJS. The canvas means text written is movable, rotatable, resizable, and can be stretched. But in this article, we will change the background color. Further, the text itself cannot be edited like a textbox.
fabric.text(text :string, textBackgroundColor:string);
Parameters: This function accepts two parameters as mentioned above and described below:
- text: It specifies the text.
- textBackgroundColor: It specifies the background color.
Program: This example uses FabricJS to change background color of canvas-like text as given below.