Creating professional color swatch legends in Adobe Illustrator is a tedious task that every designer dreads. Whether you are working on brand style guides, print production documents, or client presentations, you need clear, accurate color references that display PMS (Pantone Matching System) names and CMYK values properly.

Manually creating these legends means drawing boxes, typing text, aligning elements, and double-checking every color value. This process can take hours, especially when you have dozens of swatches to document. Worse, manual errors can lead to incorrect color specifications in your final output.

That is exactly why Akib Mahmud, a skilled developer from Bangladesh, created these three powerful Adobe Illustrator scripts under the banner of AK Visual Studio. These JavaScript-based automation tools generate complete color swatch legends instantly, saving you hours of manual work while ensuring professional, accurate results every single time.

In this comprehensive guide, we will walk you through everything you need to know about these three essential scripts. You will learn how to install them, how each script works, what features they offer, and how to customize them for your specific workflow. By the end of this blog post, you will have a complete understanding of how to automate your color swatch documentation in Adobe Illustrator.


Why You Need Automated Swatch Legend Scripts

Before diving into the scripts themselves, let us understand why automation is crucial for color documentation in professional design workflows.

Save Hours of Manual Work

Creating a swatch legend manually requires drawing multiple rectangles, typing color names, adding percentage values, aligning everything properly, and then ensuring consistency across all swatches. With these scripts, the entire process happens in seconds. Select your swatches, run the script, and you get a perfectly formatted legend ready for use.

Eliminate Human Errors

When you type color values manually, mistakes happen. A misplaced decimal, a wrong percentage, or an incorrect color name can lead to production errors. These scripts pull data directly from Illustrator's swatch library, ensuring 100% accuracy in all displayed values.

Maintain Professional Consistency

Every legend generated by these scripts follows the same clean, organized format. This consistency is crucial for brand guidelines, style guides, and professional documentation. Your clients and team members will appreciate the polished, uniform appearance.

Support Multiple Color Models

Whether you are working with spot colors, process colors, RGB, or Lab colors, these scripts handle them all. The intelligent conversion system ensures that CMYK values are always displayed correctly, regardless of the original color model.

Installation Guide: Getting Started

Let us start with a straightforward installation process that works on both Windows and Mac systems.

Locate the Scripts Folder

First, you need to find the correct scripts folder in your Adobe Illustrator installation directory. Here is the exact path you need:

For Windows Users: 
Root Drive (C:\ or other installed drive):\Adobe\Adobe Illustrator 2025\Presets\en_US\Scripts\

For Mac Users:

/Applications/Adobe Illustrator 2025/Presets/en_US/Scripts/

Note: The version number (2025) may vary based on your Illustrator version. Look for your specific version folder. 


Install the Script Files

Once you have located the scripts folder, follow these steps:

  1. Download the script files from the download links provided below
  2. Copy the .jsx or .jsxbin files to the Scripts folder
  3. Restart Adobe Illustrator completely
  4. Access the scripts from File → Scripts menu

Verify Installation

  1. To confirm the scripts are installed correctly:
  2. Open Adobe Illustrator
  3. Go to File in the top menu
  4. Hover over Scripts
  5. You should see the script names in the dropdown menu

Pro Installation Tip

If you frequently use these scripts, consider creating keyboard shortcuts:

  1. Go to Edit → Keyboard Shortcuts
  2. Select Scripts from the menu list
  3. Assign custom shortcuts to your most-used scripts
  4. Save your shortcut set

Script 1: PMS (Pantone Solid Coated) Color Value Script

PMS_COLOR_VALUE_akvisualstudio.com


The PMS Color Value script is specifically designed for designers who work with Pantone Matching System colors. This script generates a professional swatch legend that displays PMS color names with customizable text formatting. Akib Mahmud developed this script to streamline the creation of PMS documentation for print and brand projects.

What Makes This Script Unique

Unlike simple color chart generators, this script includes advanced smart sorting algorithms. It analyzes each color's brightness and hue, then arranges them in a visually appealing order. Whites and blacks are automatically placed at the end of the list, ensuring a smooth color progression that is easy to read and understand.

Key Features in Detail

Intelligent Color Sorting System

The script implements a sophisticated sorting algorithm that organizes your selected swatches in a meaningful way. First, it identifies white and black colors and positions them appropriately at the end. Then, it sorts all remaining colors by brightness, creating a natural visual flow from bright to dark. Finally, colors with similar brightness levels are grouped by hue, resulting in harmonious color families that are pleasing to the eye.

Advanced Text Formatting Options

This is where the PMS script really shines. You can configure the text appearance to match your document style. The script supports both uppercase and lowercase text formatting, allowing you to create consistent brand documentation. You can also enable or disable bold text, making the legend more readable or more subtle depending on your needs.

Flexible Layout Configuration

The script includes multiple configuration parameters that let you control every aspect of the legend's appearance. You can adjust the number of rows per column, the size of color boxes, text sizes, spacing between elements, and even the font family. This flexibility ensures the legend integrates perfectly with any document design.

Automatic PMS Name Conversion

When you use spot colors in Illustrator, they typically appear with "Pantone" in their name. This script automatically converts "Pantone" to "PMS" following industry standard conventions. If the script encounters a color that is not a spot color, it displays "PMS ERROR" in red text, making issues immediately visible.

White and Black Color Detection

The script intelligently identifies white and black colors. For white swatches, it applies a subtle black stroke to ensure the box remains visible against light backgrounds. This attention to detail ensures every swatch in your legend is clearly visible and professionally presented.

How to Use the PMS Script

Using this script is remarkably straightforward:
  1. Open your Adobe Illustrator document
  2. Navigate to the Swatches panel (Window → Swatches)
  3. Select all the PMS swatches you want to include in your legend
  4. Go to File → Scripts and choose "PMS Color Value"
  5. The script automatically generates your legend

Ideal Use Cases

Brand Style Guides


When creating comprehensive brand guidelines, you need to document all official colors clearly. This script generates clean, professional PMS legends that can be inserted directly into your style guide documents.

Print Production Documents

Print vendors require accurate color specifications. This script creates clear, unambiguous PMS references that eliminate confusion during production.

Client Presentations

When presenting color options to clients, a well-organized swatch legend makes your proposals look more professional and trustworthy.

Sample Output

The script generates a grid of color boxes with PMS names displayed to the right of each box. The legend is placed in the center of your current view, organized in a clean grid layout with consistent spacing. All elements are grouped in a named layer group, making them easy to move, hide, or delete as needed.

Script 2: CMYK Color Value Script

CMYK_COLOR_VALUE_akvisualstudio.com


The CMYK Color Value script focuses on displaying precise CMYK percentages for each selected swatch. Developed by Akib Mahmud at AK Visual Studio in Bangladesh, this script is essential for print designers who need to communicate exact color recipes to printers and production teams.

The Importance of CMYK Documentation

In the printing industry, CMYK values are the universal language for color communication. While PMS colors have standardized formulas, process colors require precise percentages to reproduce accurately. This script ensures your CMYK values are always correct and clearly displayed.

Advanced Features Breakdown

Precise CMYK Value Display

The script extracts exact C, M, Y, and K percentages from each swatch. If the swatch is in RGB or Lab color mode, the script automatically converts it to CMYK using Illustrator's built-in color conversion engine. This ensures the displayed values match what will actually print.

Comprehensive Layer Management

One of the script's most impressive features is its ability to unlock all layers in your document before running. This prevents the common error of locked layers blocking the script's operation. The script also creates an organized layer group containing all legend elements, making it easy to manage multiple legends in the same document.

Intelligent Color Detection

The script includes sophisticated algorithms for detecting specific color types:

  • White Detection: Identifies pure white colors and applies a thin black stroke to the color box, ensuring visibility
  • Rich Black Detection: Recognizes rich black formulations and treats them appropriately
  • Pure Black Detection: Identifies standard black colors for proper sorting and display

Smart Sorting with Visual Priority

The sorting algorithm in this script prioritizes visual harmony. Colors are arranged from brightest to darkest, with whites and blacks positioned for optimal viewing. This creates a natural rainbow-like progression that makes color selection and comparison much easier.

Automatic Color Conversion

No matter what color model your swatch uses, the script handles it properly. CMYK, RGB, Lab, and Gray colors are all converted accurately, with CMYK values displayed consistently across all swatches.

Step-by-Step Usage Guide

Step 1: Prepare Your Swatches
Open your Illustrator document and ensure your swatches are organized. Select all swatches you want to include. You can select multiple swatches by holding the Ctrl (Windows) or Cmd (Mac) key.

Step 2: Run the Script
Navigate to File → Scripts and select "CMYK Color Value." The script will process your selected swatches.

Step 3: Review the Output
The script generates a clean grid showing each color box with its CMYK values displayed as "C: 0%, M: 0%, Y: 0%, K: 0%" format.

Step 4: Position and Adjust
The legend is created in the center of your current view, placed in a named layer group. You can move it anywhere in your document.

Where to Use This Script

Print Production Files
When sending files to print, include a CMYK legend so printers can verify color values. This prevents miscommunication and ensures accurate color reproduction.

Quality Control Documents
For packaging design and other critical print work, CMYK legends help quality control teams verify colors match specifications.

Color Reference Sheets
Create comprehensive color reference sheets for your design team, ensuring everyone uses consistent color values.

Client Color Approvals
When clients need to approve colors before production, a CMYK legend gives them clear, measurable specifications.

Output Format

Each swatch in the legend displays:
  • A color-filled box (with stroke for white colors)
  • The CMYK values formatted as percentages
  • Clean alignment with consistent spacing
  • Black text for maximum readability
  • All elements organized in a named group

Script 3: PMS + CMYK Dual Line Script

PMS_&_CMYK_COLOR_VALUE_akvisualstudio.com


The PMS + CMYK Dual Line script combines the best of both worlds, displaying PMS color names on the first line and CMYK values on the second line. Created by Akib Mahmud for AK Visual Studio in Bangladesh, this is the ultimate all-in-one solution for comprehensive color documentation.

Why Combine PMS and CMYK?

In professional design workflows, you often need both PMS and CMYK information. Brand guidelines typically show PMS colors for logo applications, while print production requires CMYK values. Having both in one legend saves space and provides complete information at a glance.

Comprehensive Feature Set

Dual Information Display

The script displays two lines of text for each swatch:
  • Line 1: PMS name (or "Process Color" for non-spot colors)
  • Line 2: Complete CMYK percentages
This compact format provides all essential color information without requiring additional space.

Automatic Color Type Recognition

The script intelligently identifies whether each swatch is a spot color or a process color:
  • Spot Colors: Display their full PMS name
  • Process Colors: Labeled as "Process Color"
  • RGB/Lab Colors: Converted and displayed with CMYK values

Enhanced Vertical Spacing

The script automatically increases row height to accommodate two lines of text. The extra spacing ensures both lines are clearly readable without overlapping.

Complete Color Conversion

All color types are handled properly:
  • CMYK colors display their exact values
  • RGB colors convert to CMYK accurately
  • Lab colors convert through Illustrator's engine
  • Gray colors display as K-only values

Usage Instructions

Select Your Swatches

Open your document and select the swatches you want to document. For best results, include a mix of spot and process colors to see both display modes.

Run the Script

Access the script through File → Scripts and select "PMS + CMYK Dual Line."

Review the Legend

The generated legend shows:
  • Each swatch's color box
  • PMS name on the top line
  • CMYK values on the bottom line
  • Properly aligned and spaced text

Best Applications

Comprehensive Brand Guidelines

Brand guidelines often require both PMS and CMYK information. This script creates a single, compact legend that provides everything in one place.

Complete Print Specifications

When providing color specifications to printers, include both the PMS reference and the CMYK values for maximum clarity.

Color Library Documentation

Create reference libraries for your design team that show both color names and values.

Client Color Presentations

Present all color information professionally in a single, easy-to-read format.

Smart Sorting Technology Explained

All three scripts use the same advanced sorting algorithm developed by Akib Mahmud at AK Visual Studio. This algorithm ensures your swatches appear in the most logical, visually pleasing order possible.

The Sorting Process

Step 1: Color Analysis

The script analyzes each swatch to determine:

  • Its CMYK and RGB values
  • Perceived brightness using perceptual weighting
  • Hue angle in the color wheel
  • Whether it's white, black, or a rich black

Step 2: White and Black Positioning

White colors are placed at the very end of the list. This prevents them from disrupting the visual flow of the color spectrum. Black colors come just before white, creating a natural dark-to-light progression.

Step 3: Brightness-Based Ordering

Remaining colors are sorted by brightness, from brightest to darkest. This creates a smooth visual transition that makes the legend easier to scan and understand.

Step 4: Hue Grouping

When colors have similar brightness levels, they are grouped by hue. This ensures the legend shows natural color families, making it easier to find related colors.

Why This Sorting Matters

Improved Visual Appeal

Colors arranged in a logical order are simply more pleasant to look at. The sorting algorithm creates a beautiful rainbow-like progression that enhances the professional appearance of your legends.

Faster Color Finding

When colors are organized by brightness and hue, you can quickly scan the legend and find the color you need. This saves time during design work and color selection.

Better Communication

A well-organized legend communicates professionalism and attention to detail. Your clients and team members will appreciate the thoughtful arrangement.

Simplified Comparison

When similar colors are grouped together, you can easily compare them. This is especially useful when selecting between similar shades or checking color consistency.


Troubleshooting Common Issues

Even the best scripts can encounter issues. Here is a comprehensive troubleshooting guide based on feedback from users of AK Visual Studio's scripts.

Installation Problems

Script Not Appearing in Menu

If your script does not show up in the Scripts menu:
  1. Verify the folder location: Make sure you copied the script to the correct Scripts folder for your Illustrator version
  2. Check file extension: The file should have a .jsx or .jsxbin extension
  3. Restart Illustrator: Close and reopen Illustrator completely
  4. Check permissions: On Mac, ensure the file has read permissions
  5. Clear script cache: Sometimes Illustrator caches scripts; renaming the file slightly can help

Script Shows Errors

If the script runs but shows errors:
  1. Check Illustrator version: These scripts work best with CS6 and above
  2. Verify document mode: The scripts work in both RGB and CMYK documents
  3. Check selected swatches: Make sure at least one swatch is selected
  4. Ensure layers are unlocked: The script attempts to unlock layers, but locked sublayers can cause issues

Runtime Errors

"No swatches selected!" Error

This error appears when you run the script without selecting any swatches:
  1. Open the Swatches panel (Window → Swatches)
  2. Click on the swatches you want to document
  3. Hold Ctrl (Windows) or Cmd (Mac) to select multiple swatches
  4. Run the script again

"PMS ERROR" Message

This appears for non-spot colors in the PMS script:
  1. Ensure you are using spot colors
  2. Check that the spot color has a proper Pantone name
  3. Consider using the CMYK or Dual script instead

Font-Related Issues

If the specified font cannot be found:
  1. Check your installed fonts list
  2. Change the fontName parameter in CONFIG
  3. Use a standard font like "ArialMT" or "Helvetica"

Output Problems

Swatches Not Centered
If the legend appears off-center:
  1. Check the viewCenter calculation in the script
  2. Ensure useCenteredView is set to true
  3. Manually reposition the legend after generation

Text Overlapping

If text overlaps or appears cut off:
  1. Increase itemWidth for more horizontal space
  2. Increase rowHeight for more vertical space
  3. Reduce textSize for smaller text
  4. Adjust textVerticalNudge for better alignment

Color Boxes Too Small

If color boxes appear too small:
  1. Increase boxSize in the CONFIG section
  2. Adjust itemWidth to accommodate larger boxes
  3. Consider scaling the entire legend after generation

Performance Issues

Script Runs Slowly

For large numbers of swatches:
  1. Select fewer swatches at a time
  2. Close unused panels and documents
  3. Increase system resources for Illustrator
  4. Use the script during off-peak hours

Illustrator Becomes Unresponsive

If Illustrator freezes during script execution:
  1. Wait a few moments - large documents take time
  2. Force quit if necessary (loss of unsaved work possible)
  3. Reduce the number of selected swatches
  4. Split swatches into multiple batches

Pro Tips for Maximum Efficiency

These professional tips from Akib Mahmud will help you get the most out of these scripts.

Organize Your Swatches First

Before running any script, take time to organize your swatches:
  1. Name swatches clearly: Use consistent naming conventions
  2. Delete unused swatches: This reduces clutter and processing time
  3. Group related colors: Keep your swatches organized in the panel
  4. Create swatch libraries: Save organized swatch sets for reuse

Customize Configuration for Your Needs

Each script has extensive configuration options. Take time to find settings that work for your workflow:
  1. Adjust for document size: Larger documents need larger text
  2. Consider your audience: Clients need readability, production needs accuracy
  3. Match your brand: Use your brand fonts and colors
  4. Save custom versions: Create modified scripts for different use cases

Create Keyboard Shortcuts

Speed up your workflow with keyboard shortcuts:
  1. Go to Edit → Keyboard Shortcuts
  2. Select "Scripts" from the dropdown
  3. Assign shortcuts to your most-used scripts
  4. Save your shortcut set

Batch Process When Possible

For large projects:
  1. Process swatches in logical batches
  2. Combine multiple legends in one document
  3. Create master legend documents for reference
  4. Use scripts in templates for consistency

Document Your Settings

Keep track of your configuration preferences:
  1. Note which settings work best for different projects
  2. Create configuration templates
  3. Share settings with your design team
  4. Update scripts when workflow changes


Download Links

Click the links below to download each script:





Frequently Asked Questions

Q: Can I use these scripts with older versions of Adobe Illustrator?
A: Yes, these scripts work with Illustrator CS6 and above. Some features may be limited in older versions, but core functionality remains intact.

Q: Will the scripts work with RGB documents?
A: Yes, the scripts handle RGB documents properly. All color values are converted to CMYK for display, ensuring accurate representation.

Q: Can I add more colors after generating a legend?
A: Yes, simply select additional swatches and run the script again. You will get a new legend that includes all selected swatches.

Q: How do I change the text color?
A: The blackGray parameter controls text darkness. For other colors, you can modify the script code. Contact AK Visual Studio for customization support.

Q: What happens if I select process colors in the PMS script?
A: The PMS script will display "PMS ERROR" in red text for process colors. Consider using the Dual script for mixed swatch selections.

Q: Can I change the sorting order?
A: The scripts use an optimized sorting algorithm. While you can modify this in the code, the default sorting is recommended for best results.

Q: Will these scripts work on Mac?
A: Yes, the scripts are compatible with both Windows and Mac operating systems. The installation path is different, but the scripts function identically.

Q: How do I update the scripts?
A: Download the latest version from AK Visual Studio's website and replace your existing script files. Always test updates on non-critical documents first.

Q: Can I use these scripts commercially?
A: Yes, these scripts are free to use for both personal and commercial projects. Attribution to AK Visual Studio is appreciated but not required.


About the Developer

AK Visual Studio is a professional design and development agency based in Bangladesh. Led by Akib Mahmud, the agency specializes in creating automation tools for Adobe Creative Cloud applications.

Developer Credentials
Expertise: Adobe Illustrator automation, JavaScript scripting, design workflow optimization
Location: Bangladesh
Website: www.akvisualstudio.com
Specialization: Creative tool development, design automation, workflow enhancement

Other Projects

AK Visual Studio has developed numerous tools for the Adobe Creative Suite, including:
  • Document automation scripts
  • Color management tools
  • Layout optimization utilities
  • Production workflow enhancers

Vision and Philosophy

The team at AK Visual Studio believes in empowering designers through automation. By handling repetitive tasks, their tools free up creative professionals to focus on what matters most - creating exceptional design work.

Legal Notice and Disclaimer

Terms of Use

These scripts are provided by AK Visual Studio as free tools for the design community. By downloading and using these scripts, you agree to the following terms:
  1. Use at your own risk: The scripts are provided "as is" without warranty
  2. No liability: AK Visual Studio and Akib Mahmud are not liable for any damages or losses
  3. Intellectual property: The scripts and their code remain the property of AK Visual Studio
  4. Modification: You may modify the scripts for personal use, but modified versions are your responsibility

Important Disclaimer

The developer (Akib Mahmud) and developer agency (AK Visual Studio) shall not be responsible for any issues, errors, data loss, or damages arising from the use of these scripts.

Users are advised to:

  • Test scripts in non-production environments first
  • Keep backup copies of important documents
  • Verify output before using in critical projects
  • Review and understand configuration settings
  • Maintain original script backups for reference

Customizing the scripts may lead to unexpected results. The developer and AK Visual Studio will not be responsible for any errors, data loss, or issues caused by script modifications. Use these scripts at your own risk and discretion.

Connect with AK Visual Studio

  • Website: www.akvisualstudio.com
  • Developer: Akib Mahmud
  • Country: Bangladesh
  • Year: © 2026

Conclusion

These three Adobe Illustrator scripts from AK Visual Studio represent a significant leap forward in color documentation automation. Whether you need PMS names, CMYK values, or both, there is a script perfectly suited to your needs.

The PMS Color Value Script excels at creating clean, professional PMS legends with customizable text formatting options. It is perfect for brand guidelines and style guides that require spot color documentation.

The CMYK Color Value Script provides precise CMYK values for process colors, making it essential for print production and color specification documents. Its layer management and color detection features ensure reliable, accurate output.

The PMS + CMYK Dual Line Script combines the strengths of both scripts, displaying both PMS and CMYK information in a compact, two-line format. This is the ultimate solution for comprehensive color documentation.

Developed by Akib Mahmud in Bangladesh, these scripts have been refined over multiple versions to deliver reliable, professional results. The smart sorting algorithm ensures your swatches are always presented in the most logical, visually appealing order.

Installation is straightforward - simply copy the script files to your Illustrator Scripts folder and access them from the Scripts menu. With customizable configuration options, you can tailor each script to match your specific workflow requirements.

Remember to always test scripts on non-critical documents first and keep backups of your important work. While these scripts are reliable and well-tested, responsible use ensures the best results.

Start automating your color swatch legends today and experience the time savings and professional quality that AK Visual Studio's scripts provide. Your design workflow will never be the same!


Published by AK Visual Studio | Developed by Akib Mahmud | Bangladesh © 2026

Keywords: Adobe Illustrator scripts, PMS color script, CMYK values script, color swatch legend, Pantone colors, Illustrator automation, design workflow, AK Visual Studio, Akib Mahmud, Bangladesh, graphic design tools, print production, brand guidelines, color documentation, Illustrator scripts download, free Illustrator scripts, color management, spot colors, process colors, design automation