5

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?

8

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 Nov 29 '17 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 Nov 29 '17 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 Nov 29 '17 at 16:20
2

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 Nov 29 '17 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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