![Pierce403](https://vmapp.org/images/player/000default.jpg)
: Swap color/RGB values in illustrator I am trying to swap color values - R to G and G to R in my illustration (well, a selection on it). In the end, a (200,100,0) would be (100,200,0). I
I am trying to swap color values - R to G and G to R in my illustration (well, a selection on it). In the end, a (200,100,0) would be (100,200,0).
I found various pages that does color swapping and inversion but couldn't figure out a way to do this.
Could anyone help me with that or lead me to an answer if it already exists?
Thanks!
More posts by @Pierce403
2 Comments
Sorted by latest first Latest Oldest Best
Thanks to @JohnB 's suggestion, I solved the issue with a simple script. I found a template function on another page and modified it a bit. In case anyone else needs it (or wants to improve it), this seems to work for me:
var fillRGBColor = function (pathItems){
for (var i=0; i < pathItems.length; i++) {
r = pathItems[i].fillColor.red;
g = pathItems[i].fillColor.green;
pathItems[i].fillColor.red = g;
pathItems[i].fillColor.green = r;
}
}
fillRGBColor(app.activeDocument.pathItems);
Have you tired the Recolor Artwork command?
Select the object(s) that you want to recolor. In this case, I'll change the color of the orange lights on my truck.
With your object(s) selected, go to Edit > Edit Colors > Recolor Artwork
Then you can select which colors you wish to change and edit their values. In this case, I want to change the orange lights (200,100,0) to the green you gave (100,200,0). Next to the orange bar, you will see a rectangle split in half (circled in blue). Double-click that rectangle and the color picker dialog box pops up, like in my example below.
When you've swapped your colors, click Ok.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.