HSL Color Randomizer
Script for Adobe Illustrator
ㅤ
Description
HSL Color Randomizer is a powerful Adobe Illustrator script that allows you to create random color variations within specified ranges for selected objects.
Using the HSL (Hue, Saturation, Lightness) color model, it provides precise control over color randomization while maintaining the relationship between colors.
The script works with fills, strokes, and even complex objects like gradients and text, making it an invaluable tool for creating color variations, exploring color schemes, and generating unique color combinations.
ㅤ
Key Features
- Independent control over Hue, Saturation, and Lightness adjustments.
- Real-time preview functionality.
- Support for both RGB and CMYK document color modes.
- Handles multiple selected objects.
- Works with solid colors, gradients, and text objects.
- Ability to revert to original colors.
ㅤ
Installation
1. Download the Script:
- Save the HSL Color Randomizer.jsx file to your computer.
2. Place in Scripts Folder:
- For Mac: Copy the file to
/Applications/Adobe Illustrator [Version]/Presets/<Language>/Scripts/ - For Windows: Copy the file to
C:\Program Files\Adobe\Adobe Illustrator [Version]\Presets\<Language>\Scripts\
3. Restart Illustrator:
- If Illustrator was running during installation, restart it to recognize the new script.
ㅤ
Using the script
- Launch the Script: Go to File > Scripts > HSL Color Randomizer
- Configure Randomization Settings: The dialog box offers the following options:
ㅤ

ㅤ
➊ Hue Adjustment
1.1 Set the minimum hue shift value:
- Use the slider or input field (-180° to 180°).
- Negative values shift towards cooler colors.
- Positive values shift towards warmer colors.
1.2 Set the maximum hue shift value:
- This creates the range for random hue variations.
ㅤ


ㅤ
ㅤ
➋ Saturation Adjustment
2.1 Set the minimum saturation change:
- Use the slider or input field(-100 to 100).
- Negative values decrease saturation.
- Positive values increase saturation.
2.2 Set the maximum saturation change:
- This creates the range for random saturation variations.
ㅤ


ㅤ
ㅤ
➌ Lightness Adjustment
3.1 Set the minimum lightness change:
- Use the slider or input field (-100 to 100).
- Negative values darken colors.
- Positive values lighten colors.
3.2 Set the maximum lightness change:
- This creates the range for random lightness variations.
ㅤ


ㅤ
ㅤ
➍ Finalizing Changes
- Click OK button to apply the current adjustments.
- Click Cancel button to revert to original colors.
ㅤ
Tips for Best Results:
- Start with smaller ranges to maintain color cohesion.
- Use Preview mode to check results before applying.
- For subtle variations, keep ranges within 20-30 units.
- For dramatic changes, expand ranges to their maximum.
- When working with gradients, adjust ranges carefully to maintain smooth transitions.
ㅤ
Limitations:
⚠︎ The script does not apply adjustments to:
✖ Raster Images.
✖ Pattern Swatches.
✖ Effects/Appearances.
✖ Freeform Gradients.
✖ Gradient Meshes
ㅤ
ㅤ
➎ Additional Features
🅰 Preview Mode:
- Toggle the Preview checkbox to see changes in real-time.
- Uncheck to view original colors.
- Re-check to view adjusted colors.
ㅤ
🅱 User Guide:
- Click the icon ⏼ in the bottom right corner to access the user guide.
ㅤ
Fine-Tuning:
- Use arrow keys in input fields for precise adjustments:
- Up/Down: Adjust by 1 unit.
- Shift + Up/Down: Adjust by 10 units.
ㅤ
Technical Notes:
- The script automatically handles color mode conversion between RGB and CMYK.
- Original colors are preserved until OK button is clicked.
- All adjustments are non-destructive until finalized.
- Works with grouped objects and compound paths.
- Supports multiple selection of different object types.
ㅤ
ㅤ
☻ㅤWrap-Up
The HSL Color Randomizer empowers you to break creative ruts and discover unexpected color harmonies in seconds.
By balancing precise control with playful randomness, it’s perfect for adding subtle color variations to your artwork, generating branding palettes, gradient variations, or creating dynamic experimental designs.
ㅤ
ㅤ