Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Changing Colors without Swatches in Javascript

$
0
0

I'm very new to javascript and I am writing a script to find all pathItems  of a specified fill color and change them to another fill color.  This must be done in RGB or hex without using swatches.  So far I've put together bits of other scripts I found but I'm running into a lot of errors.  Here is what I have so far:

 

var myDoc =app.activeDocument

var fillRGBColor = function (pathItem){

    var fillColor = new Array();

    fillColor[0] = myDoc.pathItem.fillColor.red;

    fillColor[1] = myDoc.pathItem.fillColor.green;

    fillColor[2] = myDoc.pathItem.fillColor.blue;

return fillColor;

    }

fillRGBColor();

var pathItems = myDoc.pathItems;

for (i=0; i<pathItems.length; i++){

    fillColor[255,255,255] ==fillColor[50,50,50];

    }

 

 

Thank you!


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>