Gradient Type Switcher

Gradient Type Switcher

Script for Adobe Illustrator

Description

Gradient Type Switcher converts gradient fills and strokes between linear and radial types in Adobe Illustrator. It can reverse every selected gradient, perform a one-way conversion, or randomly assign Linear or Radial to each gradient while retaining the original gradient stops, colors, opacity, midpoint settings, placement, direction, length, and radial highlight properties.

Features

The script provides controlled gradient conversion for individual objects and complex selections without requiring gradients to be rebuilt manually.

  • Four conversion modes: Switch every gradient to its opposite type, perform either one-way conversion, or randomly assign Linear or Radial to each gradient.
  • Random type assignment: Give every eligible fill and stroke an independent random gradient type while keeping the preview and final result consistent.
  • Fill and stroke control: Process gradient fills, gradient strokes, or both in one operation.
  • Complex selection support: Find gradient artwork inside selected groups and compound paths.
  • Live preview: See the selected conversion on the canvas and update it immediately when settings change.
  • View assistance: Fit the initially selected gradient artwork in the window for closer inspection.
  • Distraction-free preview: Hide selection edges and bounding boxes while evaluating the result.
  • Reliable cancellation: Restore the original artwork, gradient angles, view, and selection display when Preview is disabled or the dialog is canceled.

Installation

1. Download the Gradient Type Switcher.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 > Gradient Type Switcher

5. Alternatively, run it directly via File > Scripts > Other Script... and browse to the file location

Tip: You can also drag and drop the .jsx file directly onto the Illustrator workspace to run the script instantly – no installation needed.

Using the Script

Launch the Script

Open an Illustrator document and select one or more objects that contain gradient fills or gradient strokes. The selection may include individual paths, groups, compound paths, or a combination of supported artwork.

Launch Gradient Type Switcher using either method:

  • Choose File > Scripts > Gradient Type Switcher when the script is installed in the Scripts folder.
  • Choose File > Scripts > Other Script... and select Gradient Type Switcher.jsx from its saved location.
  • Drag the JSX file onto the Illustrator workspace to run it without installation.

Illustrator switches to the Selection Tool and opens the Gradient Converter dialog:

image gallery

➊ Prepare the Selection

Before choosing conversion settings, confirm that the selected artwork contains at least one gradient fill or stroke. The script searches through selected groups and compound paths and ignores paints that are not gradients.

  • Select every object you want to process before launching the script.
  • Gradient-filled and gradient-stroked objects may be included in the same selection.
  • Solid colors, patterns, and objects without a matching gradient remain unchanged.
  • Locked or hidden artwork must be made selectable before the script is launched.

➋ Choose a Conversion Mode

Use the Conversion Mode panel to decide which gradient types should change. Only one mode can be active at a time.

  • Convert all gradients to the opposite type: Changes linear gradients to radial and radial gradients to linear. This is the default setting.
  • Convert linear gradients to radial: Changes only linear gradients and leaves radial gradients untouched.
  • Convert radial gradients to linear: Changes only radial gradients and leaves linear gradients untouched.
  • Switch gradient types randomly: Independently assigns Linear or Radial to each eligible gradient fill and stroke. A gradient remains unchanged when its randomly assigned type matches its current type.

When Preview is enabled, selecting a different mode updates the artwork immediately. Choosing the random mode generates a set of random assignments that remains stable through the live preview and final application, so clicking OK preserves the result shown on the canvas.

image galleryimage gallery
Convert linear gradients to radial and vice-vera

➌ Choose Where to Apply the Conversion

Use the Apply To panel to control which paint attributes are processed. Fills and Strokes are both selected by default.

  • Enable Fills to process gradient fills.
  • Enable Strokes to process gradient strokes.
  • Enable both options to process all matching gradient fills and strokes in the selection.
  • Disable an option to leave that paint attribute unchanged.

If neither enabled option contains a gradient that matches the chosen conversion mode, no artwork is converted.

➍ Review the Live Preview

Preview is enabled by default and displays the current conversion directly on the canvas. Changing the conversion mode or the Fills and Strokes settings rebuilds the preview from the original artwork, helping prevent changes from accumulating across previews.

  • Clear Preview to restore the selected artwork to its original state while keeping the dialog open.
  • Select Preview again to apply the current settings as a new preview.
  • Use the preview to compare linear and radial results before committing the conversion.
  • Select Switch gradient types randomly again to generate a new random arrangement when you want another variation.
  • Expect nonmatching gradients and nongradient paints to remain unchanged.

Disabling Preview also removes temporary preview swatches from the Swatches panel.

➎ Adjust the Preview View

Use the view controls to inspect the converted artwork more clearly. These controls affect how the document is displayed, not the gradient conversion itself.

  • Enable Fit in Window to center and fit the gradient-bearing items from the initial selection in the active view.
  • Disable Fit in Window to return to the zoom level and view position captured when the script started.
  • Keep Hide Edges enabled to hide selection outlines and bounding boxes during preview. This option is enabled by default.
  • Disable Hide Edges when you need to see the selected paths and bounds.

Fit in Window is unavailable when the initial selection contains no detected gradient fills or strokes.

➏ Apply the Conversion

After reviewing the preview, click OK to apply the selected settings. The script restores the clean original state first and then performs one final conversion so the committed result matches the current controls.

The completed conversion preserves the following gradient data where Illustrator supports it:

  • Gradient stop colors and positions
  • Stop opacity and midpoint values
  • Gradient origin, direction, and length
  • Radial highlight angle and highlight length
  • Separate fill and stroke placement on each processed item

Afterward, a confirmation message reports how many fill gradients and stroke gradients were converted.

Tip: Click Cancel or close the dialog with its window close button to discard the preview and leave the artwork unchanged. The script restores the original selected artwork, including gradient angles that Illustrator cannot reliably reconstruct through basic gradient property assignments.

☻ Wrap-Up

Gradient Type Switcher provides a focused way to convert linear and radial gradients across fills, strokes, groups, and compound paths while preserving their essential appearance. Use its live preview and view controls to compare results, then apply the conversion with OK or exit safely with Cancel.

Leave a comment

Gradient Type Switcher

Version: 1.0.0

Updated:

  • 1.0.0 – Initial release.

    Tested on MacOS:

    • Adobe Illustrator 2024 (28.1)
    • Adobe Illustrator 2025 (29.8)
    • Adobe Illustrator 2026 (30.3)
  • Supported Versions:

    • Compatible with Adobe Illustrator CS6 and later, including Adobe Illustrator CC versions.

    Operating Systems:

    • Works on both macOS and Windows platforms.
  • End User License Agreement (EULA)

    Last Updated: 21.12.2024

    This End User License Agreement (“Agreement”) is a legal agreement between you (“User” or “Licensee”) and Samolevsky.com (“Licensor”) regarding the use of the Adobe Illustrator scripts (“Software”). By downloading, installing, or using the Software, you agree to be bound by the terms of this Agreement.

    1. Grant of License

    Licensor grants the User a non-exclusive, non-transferable, and revocable license to use the Software in accordance with this Agreement.

    • Free Software: If the Software is provided for free, you may use it for personal or commercial purposes without payment, subject to the restrictions outlined in this Agreement.
    • Paid Software: If the Software is provided for a fee, you may use it only after payment has been made in full.

    2. Usage Rights

    You are permitted to:

    • Install and use the Software on devices you own or control.
    • Use the Software in your personal or commercial projects, subject to compliance with this Agreement.

    3. Restrictions

    You may NOT:

    • Reverse engineer, decompile, or otherwise attempt to discover the source code, underlying ideas, or algorithms of the Software.
    • Reuse, incorporate, or integrate any portion of the Software into any other software, product, or project, except as expressly permitted by the Licensor in writing.
    • Resell, redistribute, or share the Software, whether in its original or modified form, without prior written consent from the Licensor.
    • Claim ownership of the Software or its underlying code.
    • Use the Software in any way that violates applicable laws or regulations.

    4. Ownership

    The Software and all intellectual property rights therein remain the exclusive property of the Licensor. This Agreement does not transfer ownership of the Software or any intellectual property rights to the User.

    5. Disclaimer of Warranties

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    6. Limitation of Liability

    To the maximum extent permitted by law, Licensor shall not be liable for any damages, including but not limited to direct, indirect, incidental, special, or consequential damages, arising out of or related to the use or inability to use the Software.

    7. Termination

    This Agreement is effective until terminated. Licensor may terminate this Agreement immediately if you breach any term of this Agreement. Upon termination, you must cease all use of the Software and destroy any copies in your possession.

    8. Updates and Support

    Licensor is not obligated to provide updates, support, or maintenance for the Software. However, updates may be provided at the sole discretion of the Licensor.

    9. Governing Law

    This Agreement shall be governed by and construed in accordance with the laws of the State of New York, without regard to its conflict of law principles.

    10. Entire Agreement

    This Agreement constitutes the entire agreement between you and the Licensor concerning the Software and supersedes all prior or contemporaneous understandings regarding such subject matter.

    By using the Software, you acknowledge that you have read this Agreement, understand it, and agree to be bound by its terms.

    For any questions or concerns regarding this Agreement, please contact us at hello@samolevsky.com

Browse More Scripts

  1. Explore Gradient Type Switcher
    Gradient Type Switcher

    Gradient Type Switcher

    Gradient Type Switcher converts gradient fills and strokes between linear and radial types in Adobe Illustrator. 

    Explore
  2. Explore Sequential Text Numbering
    Sequential Text Numbering

    Sequential Text Numbering

    Sequential Text Numbering automates numbering and labeling across selected text frames in Adobe Illustrator.

    Explore
  3. Explore Quick Resize
    Quick Resize

    Quick Resize

    Quick Resize is a floating panel for Adobe Illustrator that resizes selected objects to an exact width or height.

    Explore

Introducing ScriptBox

Your Complete Adobe Illustrator Productivity Hub

Required Software

Adobe Illustrator

Adobe Illustrator is a professional vector graphics software developed by Adobe Inc. It is widely used by designers, illustrators, and artists for creating a variety of digital artwork, including logos, icons, illustrations, typography, and complex design layouts. Illustrator is known for its precision and scalability, allowing users to create high-quality graphics that can be resized without losing clarity. Its features include powerful drawing tools, customizable brushes, advanced typography options, and seamless integration with other Adobe Creative Cloud applications. Illustrator is a go-to tool for creative professionals working on projects for print, web, and multimedia platforms.

  • 🅰 Locating the Scripts Folder

    To install a Gradient Type Switcher.jsx script in Adobe Illustrator, you need to place it in the correct directory where Illustrator
can recognize it. Follow these steps to locate the Scripts folder:

    1. MacOS:
      Open Finder and navigate to:
      Applications/Adobe Illustrator <Version>/Presets/<Language>/Scripts
    2. Windows:
      Open File Explorer and navigate to:
      C:\Program Files\Adobe\Adobe Illustrator <Version>\Presets\<Language>\Scripts
    3. Replace <Version> with your Adobe Illustrator version (e.g., 2025).
    4. Replace <Language> with your language folder (e.g., "de_DE" for German, "en_US" for English).

    🅱 Installing the Script

    1. Copy the Script File: Copy the Gradient Type Switcher.jsx file to the Scripts folder located in the path above.
    2. On some systems, you may need administrator permissions to modify the Scripts folder.
    3. Restart Adobe IllustratorTo refresh the scripts menu, close and reopen Adobe Illustrator.

    Explore our complete guide to mastering Adobe Illustrator scripts.

    1. Open Adobe Illustrator and ensure a document is active.
    2. Go to the top menu bar and select File > Scripts.
    3. If the script is installed in the Scripts folder, it will appear in the dropdown list.
    4. Click the Gradient Type Switcher script to run it.
    5. The Gradient Type Switcher script will execute, and any dialog boxes or results will appear based on the script’s functionality.

    ☻ Before running any scripts, it’s strongly advised to save your work — especially when working with complex or large documents.

Got questions?

Need help or have an idea to share? We’d love to hear from you! Whether you have questions, found a bug, have a feature request, or just want to share your feedback, reach out to us—we’re here for you!