Copy link to clipboard
Copied
I wonder if there is a possible script that can just set the current fill color choice to certain one.
( not apply the fill on a drawing or a shapes )
just set it to be current color choice in the tools small square.
same for the stroke.
this would be help to quickly assignt shortcutes to specific colors (or if possible gradiences).
while we focus on art instead of manually selecting colors. ^^
Copy link to clipboard
Copied
yes, you can use jsfl for that. eg, to change the toolbar fill to a green-red-blue linear gradient:
var fill = fl.getDocumentDOM().getCustomFill("toolbar");
fill.style = "linearGradient";
fill.colorArray = [ 0x00ff00, 0xff0000, 0x0000ff ];
fill.posArray = [0, 100, 200];
fl.getDocumentDOM().setCustomFill( fill );
Copy link to clipboard
Copied
oh my god thank you so much Im so happy this is possible I will look more into it to set my colors and make commands !
THANK YOUUUU
Copy link to clipboard
Copied
and if say do not want a strocke there. just fill to take effect and stroke to non.
or I wanted a certain stoke but set fill to none ?
Im looking into the documention and tried your script it works !
Copy link to clipboard
Copied
and for no fill, the "noFill" works:
var fill = fl.getDocumentDOM().getCustomFill("toolbar");
fill.style = "noFill";
fl.getDocumentDOM().setCustomFill(fill);
Copy link to clipboard
Copied
I tried to set style to "none" but nothing happened
Copy link to clipboard
Copied
you're supposed to be able to set the stroke to none by using its style = "noStroke", but that doesn't work.
you can work-around that by setting the fill to noFill and then swapping fill and stroke:
var dom = fl.getDocumentDOM();
var fill = dom.getCustomFill("toolbar");
fill.style = "noFill";
dom.setCustomFill(fill);
dom.swapStrokeAndFill();
unfortunately, that will mess up your fill so you'll need to set that after doing the swap.
Copy link to clipboard
Copied
oops, i found a better way:
var stroke = fl.getDocumentDOM().getCustomStroke("toolbar");
stroke.color = "#00000000";
fl.getDocumentDOM().setCustomStroke(stroke);