federico-moretti / canvas-free-drawing

A JavaScript library that allows you to draw in a canvas HTML element, straightforward to use and extremely lightweight.
https://www.federicomoretti.dev/projects/canvas-free-drawing
MIT License
65 stars 11 forks source link

how to set backgourd-color transparent? #13

Closed cwwjsyc closed 3 years ago

cwwjsyc commented 3 years ago

how to set backgourd-color transparent?

federico-moretti commented 3 years ago

Did you try to do something like cfd.setBackground([0,0,0,0]) ?

federico-moretti commented 3 years ago

Ok, I did try it myself and it works fine. If you want to set it as default, you have to use cfd.setBackground([0,0,0,0], true) or set the background during the init.

cwwjsyc commented 3 years ago

Learning ! Thanks。