• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Why swapping multiple colors of multiple objects at once not possible?

Community Beginner ,
Feb 26, 2024 Feb 26, 2024

Copy link to clipboard

Copied

Hello,

 

If you select an object in Illustrator, you can swap the fill and stroke colours of that objects, obviously.

If you select multiple objects with for example different stroke colors, the swapping tool is in ghost.

 

Why is this? The swapping of the colors is happening within the object. It should be a legitimate action to swap multiple objects with different colors.

 

Who's with me. 

 

 

 

 

TOPICS
Feature request

Views

44

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 Expert ,
Feb 26, 2024 Feb 26, 2024

Copy link to clipboard

Copied

LATEST

InDesign can do it by default. In Illustrator you may use a script.

 

Among others, @femkeblanco has written a good one (see below).

 

// Script by femkeblanco
// to swap fills and strokes of selected items
var array = [];
function push(items) {
    for (var i = 0; i < items.length; i++) {
        if (items[i].typename == "PathItem") {
            array.push(items[i]);
        } else if (items[i].typename == "GroupItem") {
            push(items[i].pageItems);
        } else if (items[i].typename == "CompoundPathItem") {
            push(items[i].pathItems);
        }
    }
}
push(app.selection);
for (var i = 0; i < array.length; i++) {
    var fill = array[i].fillColor;
    var stroke = array[i].strokeColor;
    array[i].fillColor = stroke;
    if (!array[i].stroked) array[i].stroked = true;
    array[i].strokeColor = fill;
}

Votes

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