What I'm trying to do is this: using Fabricjs, I have the I also tried Despite my efforts, the color of the canvas background does not return, does anyone have to do this? The HTML canvas is transparent by default. When an empty canvas is pulled, then the background of the body will be visible. To set the background color in the fabric JS, do this: Unless you have already set the background color, you can retrieve it like this: warning ("BG Color : "+ Canvas.getBackgroundColor ()) However, that method does not exist
canvas.backgroundColor , but it returns an empty string .
canvas. Background color = 'red';
var bkColor = canvas. BackgroundColor; Alternatively, you can set the background in CSS because the canvas making Fabelajs will take you the CSS of the canvas element of the first supply:
# MyCanvas {background-color: "sky blue"; }
No comments:
Post a Comment