Some of the larger publications that I work on accumulate a gazillion color swatches, and I would like to be able to sort them. In the past I've done this manually, by CMYK value. But this is time-consuming and often results in visually convoluted arrangements. The greens are not all together, there are pastels up in the reds and yellows, etc. I would like to do this with a script, to save time and make it more perceptually pleasing and useful.
Any help or advice would be much appreciated. Or if you're a scripting angel, maybe you'd like to write it for me. I've written scripts before, but I'm not sure the best way to iterate through the swatches, or how to sort them into folders or group them.
The basic sorting method I want is to group the swatches in folders like so (each bullet point would be a separate folder in the Swatches palette — or maybe just grouped together in a flat list — could be an option in the script ... and the formula that follows each bullet points describes the criteria for the colors in that group and how they would be sub-sorted):
- Magentas: If M >127 and CYK <64, sort by density
- Reds: If MY >127 and CK <64, and M>=Y, sort by density
- Oranges: If MY >127 and CK <64, and Y>M, sort by density
- Yellows: If Y >127 and CMK <64, sort by density
- Warm Greens: If CY >127 and MK <64, and Y>=C, sort by density
- Cool Greens: If CY >127 and MK <64, and C>Y, sort by density
- Cyans: If C >127 and MYK <64, sort by density
- Blues: If CM >127 and YK <64, and C>=M, sort by density
- Purples: If CM >127 and YK <64, and M>C, sort by density
- Darks: All values are >85, sort by dominant CMY, then by density
- Pastels: All values are <15, sort by dominant CMY, then by density
- Grays: Any where the CMY values are +/- 5 from their average (which also includes CMY=0), sort by dominant CMY value then by density.
- Everything else: Sort by dominant CMY then by density
(In the above section, "If MY >127" means, "If M and Y are both individually less than 127", etc.)
For gray calculation: Average = (C+M+Y)/3
For density sorting: Density = L from (L * a * b), or other formula to calculate lightness/darkness value such as: Density = (C * 0.49) + (M * 0.6) + (Y * 0.07) + (K * 0.91)
For RGB swatches, convert RGB colors and process as CMYK?
Drop all spot colors in their own folder (or at top of list).
Drop all gradients in their own folder (or at end of list).