Skip to main content
Participating Frequently
April 24, 2022
Question

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

  • April 24, 2022
  • 1 reply
  • 951 views
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.

( 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. ^^

 
 
 
    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    April 25, 2022

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

    Participating Frequently
    April 25, 2022

    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