is there a script to set the current fill/stroke color "choice" to whatever color code ?

New Here ,
Apr 24, 2022 Apr 24, 2022

Copy link to clipboard

Copied

is there a script to set current fill or stroke color choice to (whatever color code) ?


I wonder if there is a possible script that can just set the current fill color choice to certain one.
Screen Shot 2022-04-24 at 9.57.09 AM.png
( 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. ^^

 
 
 

Views

85

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 24, 2022 Apr 24, 2022

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 );

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 24, 2022 Apr 24, 2022

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 24, 2022 Apr 24, 2022

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 !

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 25, 2022 Apr 25, 2022

Copy link to clipboard

Copied

LATEST

and for no fill, the "noFill" works:


var fill = fl.getDocumentDOM().getCustomFill("toolbar");
fill.style = "noFill";
fl.getDocumentDOM().setCustomFill(fill);

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 24, 2022 Apr 24, 2022

Copy link to clipboard

Copied

I tried to set style to "none" but nothing happened Screen Shot 2022-04-24 at 11.21.06 PM.png

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 25, 2022 Apr 25, 2022

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.

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 25, 2022 Apr 25, 2022

Copy link to clipboard

Copied

oops, i found a better way:

 

var stroke = fl.getDocumentDOM().getCustomStroke("toolbar");
stroke.color = "#00000000";
fl.getDocumentDOM().setCustomStroke(stroke);

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines