[solved] Selecting the same color across the image

Post questions on how to use or achieve an effect in Inkscape.
DragonStar
Posts: 15
Joined: Thu Apr 24, 2008 3:39 am

[solved] Selecting the same color across the image

Postby DragonStar » Tue May 06, 2008 3:45 am

I'm working on the image here:
viewtopic.php?f=9&t=959

It uses three colors. I'd like to quickly change the three colors to try out different combinations. To achieve the effect, I have, say, the mauve on the lowest later, then details of it on the highest layer, with the bubblegum pink swirls between. This creates a nice contrast of pink swirl on mauve background.

When I select all the mauve objects and union them, the depth is destroyed.

How can I select all instances of one color simultaneously while preserving their depth in the layer hierarchy? Alternatively, how can I group them only by what is visible (like the magic wand in photoshop would do, for example, or Select > color range?

Thanks!

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Selecting the same color across the image

Postby microUgly » Tue May 06, 2008 9:32 am

Under the effects menu you'll find colour > replace colour, which I think will do the job.

However, I prefer to use gradients for all colouring because they can be reused across multiple objects. To use this method in 0.46 you need to go to the Inkscape Preferences and under Misc, untick "Prevent sharing of gradient definitions". You can then use the same gradient on multiple objects and only have to edit the gradient once to have all objects change.

If you go into the XML editor you can even delete the extra gradient stops so you only work with the one stop to keep a flat colour.

DragonStar
Posts: 15
Joined: Thu Apr 24, 2008 3:39 am

Re: Selecting the same color across the image

Postby DragonStar » Tue May 06, 2008 10:54 am

That's a cool tip. I will investigate it on my next project.

DragonStar
Posts: 15
Joined: Thu Apr 24, 2008 3:39 am

Re: Selecting the same color across the image

Postby DragonStar » Wed May 07, 2008 5:13 am

replace color worked great. It took a long time to figure out though. Inkscape uses the rgb and a transparency value, so solid white is ffffff plus ff. Replace color uses only the first six characters.

User avatar
kelan
Posts: 178
Joined: Thu Sep 06, 2007 12:55 am
Location: Unicorn of Open Source
Contact:

Re: Selecting the same color across the image

Postby kelan » Wed May 07, 2008 9:59 pm

The reason for that is a discrepancy between the SVG spec and the way Inkscape presents color values. In the Fill and Stroke dialog, Inkscape does present Alpha right along the RGB, and even smooshes them altogether in one string of characters in the lower right corner. However, in the actual XML, the alpha values for fill and stroke are stored separately from the RGB values for a given object. Thus it was easier for the writer of the Replace Color script to work on just the RGB because that's how it's stored in the XML.


Return to “Help with using Inkscape”