Color Swatches, Change HSB v3

Use this Forum for Beta-Testing your Photoshop Scripts

Moderators: Kukurykus, Tom, xbytor


Color Swatches, Change HSB v3

Post by garek007 »


I'm working on a script to take the foreground color and generate variations on that color. The script makes a new document then lays out square fills of color that are variations on the foreground color. I've got it working so that it makes three columns. Each column is slightly lower in saturation, each row down subtracts hue and each square across subtracts brightness.

The starting color may be 76 brightness but the script adds 20 so that the script starts with 96 brightness and drops below 76. This is meant to give enough variation to properly match a paint swatch or something similar.

I'd like some people to test, but also my main question is this:

I'm using a lot of global variables in this script. I've been informed that this is not really the best practice. Can some experts look at this and tell me if there is a better way to organize this so that I am not using globals. Can you also tell me if there would be a way to speed this script up. It takes a while to run and I'd like it to run a bit faster.