Page 1 of 3

ColorTool - Change colors in document, copy and paste etc.

Posted: Thu Dec 23, 2010 9:38 pm
by ponysmasher
I wanted a button for swapping the fill and stroke of shapes so I wrote that.
Then I wanted to be able to copy more than one fill and stroke at a time. Then I wanted to be able to replace colors in group layers.
And then in entire documents.
And then I wanted to add several other functions but here's where I've gotten so far.

Get it here: DS_ColorTool.zip

The tool is based on the select shape tool in AS pro so it has all of the same functions and you can replace it if you want.

The first button is swap. It will swap the fill and stroke of a selected shape.

Image

The second button is stroke to fill which simply sets the fill color to the same color as the stroke.

Image

The fill to stroke button does the opposite.

Image

Next we have some swatches with copy and paste buttons. These are for copying and pasting colors between shapes.
The left swatch is for fill and the right for stroke. This is used in case you want to copy more than one color from another layer, instead of copying one at a time and moving between layers you can copy three colors at once (five with the extended version of the script).

Image

These swatches also serve another purpose. We can replace colors in layers or the entire document.
Set the leftmost swatches to the fill and stroke you wish to replace and the right swatches to the new colors that you want.

Image

You can select to replace colors in the entire document or just the layer selected.

Image

If you have selected a group layer, switch layer or bone layer, the color will be changed in the child layers.

The script currently only goes four levels deep. That is it can replace the colors of a layer in a group within a group within a group. That´s four levels right?
Anyway, it will go four levels deep from the layer selected so you can always go deeper manually.

You can select to replace just fills or just strokes.

By setting tolerance you can also replace colors similar to the one you selected.

A tolerance value of one will only replace colors that match exactly and a value of 256 (the highest) will replace all colors.
For instance if I set the new stroke color to black and the tolerance to 256, all strokes will become black no matter what color they were before.

Image

With a tolerance level of say 50, only colors that are similar will be affected.

One thing you could do is to set the fill to transparent and the tolerance to 256 and you would get a document with only strokes. Not sure why you would do it, but you can!

Image

There are two versions of this script. The extended version has more swatches and is only suitable if you have a high resolution screen.

Posted: Thu Dec 23, 2010 11:12 pm
by ulrik
Hi Ponysmasher, this is a great script/tool you have written, thank's a lot for sharing with us!! :D

and Happy Christmas to you and everybody on this forum!

Posted: Fri Dec 24, 2010 4:30 am
by F.M.
Thank you very much, for sharing!

Posted: Sat Dec 25, 2010 2:32 pm
by Rudiger
Does it work with Fazek's customised tools that can select multiple shapes at once? If so, would be outstanding!

Posted: Sat Dec 25, 2010 10:50 pm
by funksmaname
Amazing, and I'm with Rudiger - if the relevant parts can be moved to fazek's tool it will be even amazing-er! :)

Posted: Sat Dec 25, 2010 11:05 pm
by ponysmasher
Hmm, I've had Fazek's tools installed since forever but there's no select shape tool among them. I'll have to download them again and have a look.

Posted: Sat Dec 25, 2010 11:30 pm
by funksmaname
i think you're right actually - you can select multiple shapes with the create shape or move shape/bone tools, but if you make any colour changes it only effects 1 shape of the group selected... i think I still use the bog standard shape select tool, although it would be cool to add a multi shape select/effect functionality to it.

p.s. i just discovered if you select a shape and alt click another shape with the select shape tool it copies the colours between them... (AS7)

Posted: Sun Dec 26, 2010 5:39 am
by Rudiger
Yeah, I think Fazek just added shape selection to the universal translate tool, so there was no need for a separate select shape tool.

I guess funksmaname request is better then. Perhaps just add multiple shape select to your modified version of the select shape tool. Then you could make it so that if no shapes are selected it acts on all shapes, but if one or more shapes are selected it only acts on them. You should then have all of your bases covered!

I have also written scripts in the past that select mutliple shapes based on selected points or point groups. You could perhaps integrate something like that into your tool as well, ie have a drop down points group list, but it selects all of the shapes that belong to the group instead of the points.

Posted: Tue Dec 28, 2010 2:04 pm
by crsP
Hi, there is a problem with your tool.

1) Create a shape with fill and stroke
2) Add a gradient to the fill
3) Using your select shape tool, select the gradient and change the spread using the handles

Results: The gradient disappears as long as you have the mouse button held down.

Expected: The gradient preview should remain so the user can adjust it visually, just like in the lm select shape tool.

Posted: Tue Dec 28, 2010 6:47 pm
by ponysmasher
crsP wrote:Hi, there is a problem with your tool.

1) Create a shape with fill and stroke
2) Add a gradient to the fill
3) Using your select shape tool, select the gradient and change the spread using the handles

Results: The gradient disappears as long as you have the mouse button held down.

Expected: The gradient preview should remain so the user can adjust it visually, just like in the lm select shape tool.
That's weird since the basic function is copied directly from the original tool. I must have messed something up. Will look into it. Thanks for the feedback.

Posted: Mon Jan 17, 2011 10:37 pm
by crsP
Hi,

Don't know if you've found the problem yet, but please could you add the box showing the shape's stack order to your tool if you can. And of course allow the user to change that order.

thanks.

Posted: Wed Jan 19, 2011 10:19 pm
by crsP
To further explain what I mean, check out the tool mod in this thread here [second to last post on page 2]:

viewtopic.php?t=1352&postdays=0&postorder=asc&start=15

Posted: Thu Jan 27, 2011 10:28 pm
by Vagabond
This is an incredibly useful tool. I now have a place to put my highlights, shadows, and base tones and they're just a click away. No more shape hunting and copying. And the swap feature is brillant!

Thank you

Posted: Thu Jan 27, 2011 11:02 pm
by foundmarble
Great script, very useful. One request, is it possible to make the swatches smaller?

Re: ColorTool - Change colors in document, copy and paste et

Posted: Mon Feb 25, 2013 9:06 pm
by spar9zedou
You just saved me an hour. Thanks a bunch!