Skip to main content
Participating Frequently
Apr 24, 2022 1:58 PM UTC
Question

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

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 is closed to new replies. Start a new post to keep the conversation going.

    7 replies

    kglad
    Community Expert
    Community Expert
    Apr 25, 2022 12:09 AM UTC

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

    Translate
    Participating Frequently
    Apr 25, 2022 2:20 AM UTC

    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

    Translate