Named or templated colors

Post questions on how to use or achieve an effect in Inkscape.
stevenbell
Posts: 2
Joined: Fri May 17, 2013 10:50 am

Named or templated colors

Postby stevenbell » Fri May 17, 2013 11:21 am

I have (and will be creating) a number of diagrams which will be used on both light and dark backgrounds. I would like to be able to create a single drawing and parameterize the colors, so that I just change the definitions of "foreground", "background", and "accent" to change the colors in the entire drawing. The same colors will be common to a handful of drawings, and I'd like to automate as much as possible. Is there a standard way of doing this?

I had hoped to do this with a custom palette, but I found that Inkscape ignores the palette color name and just uses the hex value in the saved file. I understand that you can do something like this with the "auto" palette, but I don't want to recreate the named colors in the auto palette every time. Ideas?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Named or templated colors

Postby Lazur » Fri May 17, 2013 10:47 pm

You could try adjusting a colour transformtion matrix for creating dark version of the light ones.
I'm not that familiar with that tool, but it could work.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Named or templated colors

Postby ~suv » Sat May 18, 2013 5:58 am

Inkscape Release Notes 0.48 > User Interface > Custom Swatches
Inkscape Manual » Attributes » Fill and Stroke Paint » Custom Swatches (New in v0.48)

(The next major release (0.49) will allow to give names to custom swatches - but overall, this feature is still work-in-progress, and details of the implmentation are likely to change once the next SVG specification has added support for named colors)

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Named or templated colors

Postby ~suv » Sat May 18, 2013 6:00 am

stevenbell wrote:but I don't want to recreate the named colors in the auto palette every time. Ideas?

Did you consider creating a custom default template file for this project, with the named colors already present (in the 'Auto'-palette)?

Recommended reading: Using templates in Inkscape | Libre Graphics World

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Named or templated colors

Postby ragstian » Sat May 18, 2013 6:31 am

Hi.

This would be an ideal task for a "Swap Palette" extension.

See this thread for a similar discussion ; http://www.inkscapeforum.com/viewtopic.php?f=34&t=14018

Let's start coding?
Anyone got a file dialog in XML - for use in an extension?

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Named or templated colors

Postby ragstian » Sun May 19, 2013 5:34 pm

Hi.

Version 0.1 of the "Swap Palette" extension working.
Still some polishing to do on the code before release.
See screen dump;

Image
Click image for larger version.

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar


Return to “Help with using Inkscape”