ColorTool - Change colors in document, copy and paste etc.
Moderators: Víctor Paredes, Belgarath, slowtiger
-
- Posts: 370
- Joined: Thu Aug 05, 2004 2:23 am
- Location: Los Angeles
- Contact:
ColorTool - Change colors in document, copy and paste etc.
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.
The second button is stroke to fill which simply sets the fill color to the same color as the stroke.
The fill to stroke button does the opposite.
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).
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.
You can select to replace colors in the entire document or just the layer selected.
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.
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!
There are two versions of this script. The extended version has more swatches and is only suitable if you have a high resolution screen.
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.
The second button is stroke to fill which simply sets the fill color to the same color as the stroke.
The fill to stroke button does the opposite.
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).
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.
You can select to replace colors in the entire document or just the layer selected.
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.
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!
There are two versions of this script. The extended version has more swatches and is only suitable if you have a high resolution screen.
- funksmaname
- Posts: 3174
- Joined: Tue May 29, 2007 11:31 am
- Location: New Zealand
-
- Posts: 370
- Joined: Thu Aug 05, 2004 2:23 am
- Location: Los Angeles
- Contact:
- funksmaname
- Posts: 3174
- Joined: Tue May 29, 2007 11:31 am
- Location: New Zealand
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)
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)
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.
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.
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.
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.
-
- Posts: 370
- Joined: Thu Aug 05, 2004 2:23 am
- Location: Los Angeles
- Contact:
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.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.
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
viewtopic.php?t=1352&postdays=0&postorder=asc&start=15
- foundmarble
- Posts: 91
- Joined: Fri Nov 05, 2004 12:33 am
-
- Posts: 10
- Joined: Tue Feb 19, 2013 12:02 pm
Re: ColorTool - Change colors in document, copy and paste et
You just saved me an hour. Thanks a bunch!