Invert Colors
Script for Adobe Illustrator
ㅤ
Description
Invert Colors is a simple Adobe Illustrator script that inverts the colors of selected objects with live preview functionality. Perfect for creating negative effects, exploring alternative color schemes, or quickly generating inverted versions of your artwork.
ㅤ
Features
- Live Preview: See color inversions in real-time before applying
- Multiple Color Modes: Supports RGB, CMYK, Grayscale, Spot Colors, and Gradients
- Comprehensive Object Support: Works with paths, groups, compound paths, text, symbols, raster images, placed items, and gradient meshes
- Hide Edges Toggle: Option to hide object edges for cleaner preview
- Zoom to Selection: Quickly fit selected objects in view
- Smart Revert: Cancel anytime to restore original colors
ㅤ
Installation
1. Download the Invert Colors.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. Alternatively, run it directly via File > Scripts > Other Script... and browse to the file location; or just drag and drop the Invert Colors.jsx file onto your Illustrator document window.
ㅤ
Using the Script
ㅤ
➊ Open Your Document
- Launch Adobe Illustrator
- Open an existing document or create a new one
ㅤ
➋ Select Objects
- Use the Selection Tool (V) to select one or more objects whose colors you want to invert
- You can select:Individual paths or shapesGroups of objectsText framesRaster imagesAny combination of supported object types
- Note: At least one object must be selected, or the script will display an error message
ㅤ
➌ Run the Script
- Go to File > Scripts > Invert Colors (if installed)
- Or File > Scripts > Other Script... and select the script file
- The Invert Colors dialog will appear.
ㅤ
➍ Use the Dialog Controls
The dialog provides several interactive controls:

ㅤ
Preview Checkbox
- Checked: Shows live preview of inverted colors on your selection
- Unchecked: Reverts to original colors temporarily
- Toggle this on/off to compare original vs. inverted colors
ㅤ
Hide Edges Checkbox
- Checked: Hides object edges/outlines for a cleaner view
- Unchecked: Shows object edges (default)
- Useful when you want to see the pure color effect without selection outlines
ㅤ
Zoom Button ✚
- Click to automatically fit your selection in the window
- Helps you see the full effect of color inversion
- Especially useful for large or off-screen selections
ㅤ
Cancel Button
- Closes the dialog and reverts all changes
- Returns objects to their original colors
- Safe to use at any time
ㅤ
OK Button
- Applies the color inversion permanently
- Closes the dialog
- Shows a confirmation message when complete
- Checked: Shows live preview of inverted colors on your selection
- Unchecked: Reverts to original colors temporarily
- Toggle this on/off to compare original vs. inverted colors
ㅤ
➎ Review and Apply
- With Preview enabled, examine the inverted colors
- Use the Hide Edges option if needed for better visibility
- Click the Zoom button to see the full selection
- Toggle Preview on/off to compare before and after
- When satisfied, click OK to apply the changes
- Or click Cancel to discard and keep original colors
ㅤ
Supported Color Types
- RGB Colors
- CMYK Colors
- Grayscale
- Spot Colors (converted to process colors before inversion)
- Gradient Colors (inverts all gradient stops)
ㅤ
Supported Object Types
- Path Items
- Group Items
- Compound Paths
- Text Frames
- Symbol Items
- Raster Items
- Placed Items
- Gradient Meshes
ㅤ
☻ Tips and Best Practices
- Preview First: Always use the preview feature to check results before applying
- Group Selection: Select multiple objects at once for batch color inversion
- Text Handling: The script inverts individual character colors in text frames
- Raster Images: Raster and placed images are inverted using Illustrator's native invert command
- Undo Available: If you're not satisfied after applying, use Cmd/Ctrl+Z to undo
- Complex Objects: For groups and compound paths, all nested elements are processed recursively
ㅤㅤ