Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the default selectionColor on fabric.js?

Tags:

fabricjs

how can I change the default bluish selectionColor on fabric.js? I've tried to change these lines in fabric.js but got no effect:

selectionColor: 'rgba(17,119,255,0.3)',
selectionBorderColor:   'rgba(255, 255, 255, 0.3)',
editingBorderColor: 'rgba(102,153,255,0.25)',

Is there any other way?

enter image description here

like image 604
user1576748 Avatar asked Dec 09 '22 02:12

user1576748


1 Answers

you can change the border color (it shows when you select object) of fabric objects with this parameter: borderColor

for example :

canvas._objects[0].set({'borderColor':'#fbb802'});
canvas.renderAll();

hope helps, good luck.

like image 92
Theo Itzaris Avatar answered Apr 26 '23 02:04

Theo Itzaris