I was wondering if there is a way in Illustrator to create a certain number of swatches out of a gradient. Say that I need 9 distinct colors and I want to extract these colors from a gradient. What it would return for example is the color at 10%, 20%, 30% etc in the gradient.

Is there a function in Illustrator to do this?

4 Answers 4


There's no way of doing it fully automatically in Illustrator, although I suppose it could be scripted if you feel so inclined, but there is a way of doing it with a few extra clicks!

You could add stops to your gradient, using the grid as a guide for placing the stops equidistantly.

Then click on the fill selector, hit the little menu icon in the dropdown, and choose Add Selected Colours

enter image description here

  • You could also Object\Expand the gradient object's fill to X objects. Then Add Used Colors will give you X swatches.
    – 13ruce
    Commented Nov 29, 2017 at 15:49
  • @13ruce - no doubt there are several techniques possible, another is rasterizing the gradient filled object, and simply using the eyedropper to sample parts of it.
    – Billy Kerr
    Commented Nov 29, 2017 at 15:53
  • You can actually do this automatically with an action, rasterize the gradient then mosaic the raster setting then turn selection to swatches.
    – joojaa
    Commented Nov 29, 2017 at 16:20

A nice helper tool for calculating gradient color steps outside of Illustrator is chroma.js (eg. https://vis4.net/labs/multihue/#colors=#000000,#FFCCEE,#FFFFEE|steps=9|bez=1|coL=1)

  • 1
    I don't know why someone would downvote this excellent answer. Anyhoo, I've given a +1.
    – Billy Kerr
    Commented Nov 29, 2017 at 15:40

You could play around with Blend options, which allow you to create gradients between two objects and use a specified number of steps.

It's a two-step process:

  1. Click Object > Blend > Blend Options, then, for Spacing, select Specified Steps, then enter the number of gradient steps you want, then click OK.
  2. Select the two objects you want to create a gradient between, then click Object > Blend > Make.

You can then use Object > Expand and Ungroup to work with each element separately.

Illustrator (2019) Gradients with Blend


In Illustrator 2020 (possibly before) you can "Edit Gradient" in the Gradient pane. This 'explodes' the gradient, then you can add colours to the swatch pane as per Billy Kerr's answer above. It's just a quicker way of doing the same thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.