fabricjs - Fabric.js how to set opacity of lines -


using fabric.js library, can set line width , color follows:

canvas.freedrawingbrush.width = 5; canvas.freedrawingbrush.color = "#f00"; 

is there way set opacity too? couldn't find in documentation, neither on net anywhere.

instead of using hexadecimal color code, can set color use rgba, below:

canvas.freedrawingbrush.color = 'rgba(255, 0, 0, 0.1)'; 

demo jsfiddle


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -