gotcha

Author Topic: Variables in inkscape file  (Read 440 times)

April 02, 2019, 03:05:43 AM
Read 440 times

AlphonseBC

  • Sr. Newbie

  • Offline
  • **

  • 4
Hello !

I just want to know if Inkscape provide a way to define variables in a document.
For example, if I have a drawing with many shapes using the same color (or other attributes), i would like to define a variable shape-color containing that color and reuse it in my shapes.
It could be particularly useful if i want to change the color of my shapes without doing it for each.

I know I can select several objects (with ctrl+left clic) and modify their attributes all at once but for more complex projects with objects scattered all over the documents, it becomes painful to search and select these objects each time we want to change their attributes.

Is there a way to do this ?

Thank you for your help  :wink1:
Have a nice day
  • 0.92.3
  • Windows 10

April 02, 2019, 05:01:08 AM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I think Edit menu > Find/Replace can probably help you a lot.  It can be configured to select all kinds of specific objects or styles or attributes (or other things).  You can even use XML to select.  There's probably only one tutorial for that, which is still a fairly new feature (it's not entirely intuitive) and the manual hasn't been updated in a while.  Locate the article on Inkscape in this issue of Full Circle Magazine:  http://fullcirclemagazine.org/issue-122/

And there's the much simpler way, which is Edit menu > Select Same.

Also there are some less known selection techniques which might help.  For example, touch select.  http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Select.html

I'm not quite sure what you mean about defining a shape-color.  The colors are just colors, and I don't know any way to make a particular color only work on certain types of objects (if that's what you mean).  It is possible to create a custom palette - one way is a new palette that would be available for any file, and the other way is a per-document palette.

Hopefully the better selection methods will help, but if you still are looking for a shape-color, if you can explain it a little more, we might know some way to do it.

Edit
Oh, the "shape-color" thing just hit me.  What about clones?  Change the color of (or anything about) the parent, and all the clones change at once!  http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Clones.html
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

April 03, 2019, 07:56:05 AM
Reply #2

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
I think you're asking about Swatches, which are named colors in Inkscape. Instructions how to use them are available here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Attributes-Fill-Stroke.html#Attributes-CustomSwatches

Technically, these are one-stop gradients.