-
1. Re: automatically set the stroke color as fill color
Steve Fairbairn Nov 15, 2012 2:16 AM (in response to plutonak)Shift+X swaps fill and stroke colours.
If you want to put, say, a red fill on an object that already has a red stroke, you do this on the Color panel. Drag from the stroke square to the fill square.
-
2. Re: automatically set the stroke color as fill color
plutonak Nov 15, 2012 6:00 AM (in response to Steve Fairbairn)yes, thank you but this is a manual solution, not an automatic one. I want to select a thousand objects with their respective fill color, and then have the stroke color be the fill color of each object.
-
3. Re: automatically set the stroke color as fill color
John Mensinger Nov 15, 2012 6:25 AM (in response to plutonak)I'm not a scripting guy at all, but getting an object's fill color and applying it elsewhere sounds like it should be scriptable. You should post the question in the AI Scripting Forum.
The hitch I see here is your assertion that your objects have "transparent surrounding strokes." I could be wrong, but I believe there is actually no such thing in Illustrator. Through some simple experimenting, I conclude that an object's stroke set to "no color" by choosing the blank swatch actually becomes a stroke of undetermined, or perhaps zero, weight.
Take an object with a stroke color and weight and set its stroke to no color. The weight goes away as well. One can't exist without the other, and vice-versa, with repect to stroke weight and color. Now enter a weight for that colorless stroke, and it again receives color; defaulting to black regardless of what it may have been previously.
Similarly, if you assign a color where there is no weight, a 1-point weight appears by default.
I'm not sure how/if that plays into your plans, but I just thought I'd ramble on about it here in case it's something you hadn't considered.
-
4. Re: automatically set the stroke color as fill color
Luke Jennings Nov 15, 2012 7:08 AM (in response to John Mensinger)A work around might be to use Object> Path> offset path.
-
5. Re: automatically set the stroke color as fill color
CarlosCanto Nov 15, 2012 11:04 AM (in response to plutonak)try this script
var idoc = app.activeDocument; var sel = idoc.selection; for (i=0; i<sel.length; i++) { var ipath = sel[i]; ipath.stroked = true; ipath.strokeColor = ipath.fillColor; } -
6. Re: automatically set the stroke color as fill color
Steve Fairbairn Nov 15, 2012 3:24 PM (in response to plutonak)Reply to #2:
You said in your original post, “I have a file with two squares with red and blue fill colors respectively...” not thousands, so it didn’t sound like anything that urgently needed automating.
But now Carlos has done you a nice little script, so say thank you to him nicely ;-)
-
7. Re: automatically set the stroke color as fill color
JETalmage Nov 15, 2012 4:58 PM (in response to John Mensinger)I could be wrong, but I believe there is actually no such thing in Illustrator.
You could be, and you are.
Select a path. Give it a 10 pt. red stroke, green fill.
Appearance palette: Select the red stroke.
Transparency palette: Set opacity to 0%
JET
-
8. Re: automatically set the stroke color as fill color
plutonak Nov 16, 2012 6:59 AM (in response to CarlosCanto)@CarlosCanto: Thanks a lot, I'll give it a try very soon.
@Steve Fairbairn: I am always giving preference to simple configurations when I explain what I want so that the reader does not get lost into the details.
@Luke Jennings: this offset idea is also interesting here.


