Illustrator quick tip: export a colour palette quickly

Design4 min readView on GitHub

In Illustrator it seems to be more difficult than it needs to be to export a colour palette to hex values. Using swatches gives you access to everything except hex. It’s tedious to go through the usual object, click fill, copy and paste routine. Here’s a way to export your colours quickly.

Have your colour palette ready

You may be using swatches already, or have a bunch of shapes which are filled with the colours. If you don’t draw some shapes now with each of your colours.

A simple set of shapes is all that is needed.

Select the objects and copy

Next copy each of the objects. This will copy an SVG version of your colour palette to the clipboard.

Open your text editor

It doesn’t matter what app you use here you need something to paste in what you’ve copied.

<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In  -->
<svg version="1.1"
   xmlns="" xmlns:xlink="" xmlns:a=""
   x="0px" y="0px" width="546px" height="98px" viewBox="0 0 546 98" style="enable-background:new 0 0 546 98;"
<style type="text/css">
<circle class="st0" cx="48" cy="48" r="48"/>
<circle class="st1" cx="162" cy="48" r="48"/>
<circle class="st2" cx="274" cy="48" r="48"/>
<circle class="st3" cx="386" cy="50" r="48"/>
<circle class="st4" cx="498" cy="50" r="48"/>

Yours will resemble something similar to this code.

Grab the CSS

Copy the code between <style type="text/css"> and <style>. Delete the rest, paste it back in and tidy it up so you have the hex codes left.


Each colour should correspond with Illustrator

The order each colour is should be how you made them in Illustrator. That’s all you need to know, you’ve got your hex codes.

This is something I find less tedious than selecting the object, opening the fill window and pasting the value elsewhere. It’s a technique I consider to be one of those: “why didn’t I think of this sooner”.

If you found this article useful, why not support the upkeep of this website?

Get the articles

It’s my aim to help you be a better designer. Join my monthlyish email list and I’ll send new tutorials to help you design & code beautiful websites. You can unsubscribe anytime.

Also, as a subscriber I can provide critique on your designs—send something through after you confirm your subscription.