Average Color
Script for Adobe Illustrator
ㅤ
Description
Average Color is an Adobe Illustrator script that calculates and applies the average color across selected objects. It intelligently processes fills, strokes, gradients, and opacity values, making it perfect for creating cohesive color schemes, simplifying complex artwork, or quickly unifying the appearance of multiple objects.
The script works with both path objects and text frames, supporting all Illustrator color modes (RGB, CMYK, Grayscale, and Spot colors). It features a live preview mode so you can see changes before applying them.
ㅤ
Key Features
- Average fill colors across multiple objects
- Average stroke colors across multiple objects
- Convert gradient colors to solid averaged colors
- Average opacity values across selected objects
- Live preview mode to see changes in real-time
- Support for paths, compound paths, groups, and text frames
- Works with RGB, CMYK, Grayscale, and Spot colors
ㅤ
Installation
1. Download the Average Color.jsx script file.
2. Place the script in your Adobe Illustrator Scripts folder:
⮑ Mac: /Applications/Adobe Illustrator <Version>/Presets/<Language>/Scripts
⮑ Windows: C:\Program Files\Adobe\Adobe Illustrator <Version>\Presets\<Language>\Scripts
3. Restart Adobe Illustrator if it's already running
4. Access the script via File > Scripts > Average Color
5. Alternatively, you can run it directly by selecting File > Scripts > Other Script... and browsing to the Average Color.jsx file
ㅤ
Using the Script
- Select objects in your Illustrator document that you want to average
- Run the script via File > Scripts > Average Color
- Configure options in the dialog window:
ㅤ

ㅤ
➊ Configure options in the dialog:
- Average fill colors: Averages all fill colors and applies the result to all selected objects
- Average stroke colors: Averages all stroke colors and applies the result to all selected objects
- Average gradient colors: Converts gradients to solid colors by averaging their gradient stops
- Average opacity: Averages opacity values across all selected objects
- Preview: Toggle live preview on/off
➋ Apply Average Color
- Click OK to apply the changes
- Click Cancel to revert
ㅤ

ㅤ
Color Mode Support
The script automatically detects your document's color mode:
- RGB: Averages red, green, and blue channels
- CMYK: Averages cyan, magenta, yellow, and black channels
- Grayscale: Converts to RGB/CMYK and averages
- Spot Colors: Converts spot colors to their base color values with tint applied
➌ Additional Options
ㅤ
Quick Preview
- The Preview checkbox is enabled by default, showing you changes immediately
- Uncheck it to see the original colors while adjusting settings
- All preview changes are temporary until you click OK
ㅤ
Fit Selection Button
- Click the ⊕ button in the dialog to fit your selection in the window
- Helpful for seeing the effect on large or zoomed-out artwork
➍ Working with Different Object Types
ㅤ
Paths and Shapes
The script processes all path objects including:
- Simple paths
- Compound paths
- Shapes (rectangles, ellipses, polygons, etc.)
- Objects nested in groups
ㅤ
Text Frames
The script works character-by-character on text:
- Averages colors across all characters in selected text frames
- Applies the averaged color to every character
- Works with both fill and stroke colors on text
ㅤ
Gradients
When "Average gradient colors" is enabled:
- Gradients are converted to solid colors
- The solid color is calculated by interpolating across all gradient stops
- Works for both linear and radial gradients
- Processes gradients in both fills and strokes
➎ Use Cases
ㅤ
Design Workflows
- Create Color Harmony: Select objects with different colors and average them to create a unified palette
- Simplify Gradients: Convert complex gradients to solid colors for easier editing or printing
- Match Colors: Quickly make multiple objects share the same color
- Opacity Blending: Average opacity across objects for consistent transparency
- Text Unification: Apply a single color to multi-colored text
ㅤ
Practical Examples
- Logo Simplification: Average colors in a complex logo to reduce color count
- Illustration Cleanup: Unify colors across imported or traced artwork
- Print Preparation: Convert gradients to solid colors for spot color printing
- Style Matching: Make new elements match the average color of existing artwork
ㅤ
Tips and Tricks
- Selective Averaging: Uncheck options you don't want to affect (e.g., only average fills, not strokes)
- Gradient Mode: Enable "Average gradient colors" to only affect gradients, leaving solid colors unchanged
- Preview First: Always use preview mode to see results before committing
- No Selection: If nothing is selected, the script will prompt you to select objects
☻ Conclusion
With Average Color, you have a powerful tool to streamline your color workflow and create harmonious designs effortlessly.
Whether you're simplifying complex artwork or unifying color schemes, this script saves time and helps you achieve consistent, professional results. Experiment with the various options and make it part of your creative toolkit!
ㅤ
ㅤ