1

I was able to create a .gpl file colour palette which is working fine with Inkscape. Sadly, the colours auto arranged themselves in some funny order. Probably from ffffff to 000000. All I had to do was create rectangles of desired hex colours and then save as .gpl using Inkscape. Now that I have placed the .gpl file in the palette folder and restarted Inkscape, all the colours are available when I choose the palette by name, sadly, in a messed up order. It will be great if someone can suggest a fix. Thanks.

I am using Ubuntu 18.04 and whatever the latest Inkscape that comes with it.

Please see the image below for the order in which I have stacked the colours and how it ended up appearing on the palette

enter image description here

2 Answers 2

3

This is an Inkscape extension that generators a palette from the selected objects.

  1. First install the extension – see README with options/instructions.
  2. Restart Inkscape.
  3. Use the extension by selecting your palette objects then open Extensions → Palette → generate
  4. Name the palette, select your sorting method and click Apply.

generate palette Gui

It has five sorting options:

  • "Unsorted" was renamed to "Selection/Z-Index" in v6.0+
  • HSL
  • RGB
  • X Location v6.0+
  • Y Location v6.0+

"Unsorted"/"Selection/z-index" sorts the palette first by the order the object where selected and second by the z-index.

sort by selection z-index

UPDATE:

I contributed to the extension.

In Inscape Generate Palette version 6.0 you can sort your palette by the x or y canvas location. Arranging a palette by the z-index is no longer necessary.

Instead arrange your palette in the x or y order, and select 'Sort colors' by the X Location or Y Location.

3

I don't know if this is possible inside Inkscape, but if you open the .gpl file in a text editor it's actually readable and easy to edit. Here is an example:

GIMP Palette
Name: drawing
#
153 153 153 #999999
  0 128   0 #008000
211 141  95 #D38D5F
255   0   0 #FF0000
255 127  42 #FF7F2A

The first three columns are the RGB values of the colors. The fourth column is the name of the color which will show in Inkscape when hovering over the swatch. It's set to the colors hex number by default, but it can be edited to whatever you like without affecting the color.

To change the order of the colors simply edit the order they appear in the .gpl file.

6
  • Thanks. It should work. However, will be tedious if you have many entries. Trying to find a GUI based solution. Any idea what the 3 entries before hex codes are ?
    – user227495
    Oct 3, 2019 at 0:59
  • 2
    It's the same colors represented with RGB values. Kinda strange to save both in the file. I don't know what happens if you edit the values so the hex and RGB values don't match anymore ...
    – Wolff
    Oct 3, 2019 at 5:41
  • 1
    The colours are defined by the rgb values in the first three columns. The 4th column is used as name for hovering over the colour Oct 3, 2019 at 8:18
  • @samcarter, thanks. I'll add it to the answer.
    – Wolff
    Oct 3, 2019 at 15:27
  • 1
    I understand. You will probably need some kind of plugin which adds an interface where you can move the colors around. I understand why Inkscape can't guess which order you want the colors in based on your drawing.
    – Wolff
    Oct 4, 2019 at 9:25

Your Answer

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

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