user3813860
user3813860

Reputation: 1

Change corners fill in fabric.js

How can i change fill color corners in fabric.js, but i'd like to have different color in border corners. i want to get somethinglike this:

example

Upvotes: 0

Views: 1269

Answers (1)

levon
levon

Reputation: 939

Basically, what you need to do is this...

// create a rectangle with a fill and a different color stroke
var rect = new fabric.Rect({
   left: 50,
   top: 50,
   width: 50,
   height: 50,
   fill: 'rgba(255,127,39,1)',
   stroke: 'rgba(34,177,76,1)',
   strokeWidth: 5
});
canvas.add(rect);
canvas.renderAll();

Here's a fiddle example

Upvotes: 1

Related Questions