Mobile app version of vmapp.org
Login or Join
Sarah814

: How can I color a pattern in Inkscape? How can I color a pattern in Inkscape without creating a custom pattern? I guess this should be possible, but can't make it work. I draw a square and

@Sarah814

Posted in: #HowTo #Inkscape #Patterns

How can I color a pattern in Inkscape without creating a custom pattern? I guess this should be possible, but can't make it work.

I draw a square and fill it with a color (green). Then I choose a standard pattern for the square. The green fill is gone and I have a black pattern. Now I would like to change the pattern's color. How can I do this?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Sarah814

3 Comments

Sorted by latest first Latest Oldest Best

 

@Cofer715

By example:

Suppose you made a circle and you want its fill pattern to be green vertical bars.


Make a thin green rectangle somewhere in some blank space (size is irrelevant).
copy the green rectangle. Position the copy some reasonable distance to the right (this will be the relative spacing of your pattern).
select the two green rectangles and press Alt + I (hotkey for "object --> pattern --> object to pattern").
select the circle. when you go to fill pattern, there will now be a custom pattern in the drop-down menu. e.g. "pattern7165". select this pattern.
Now you've got green vertical bars!
(you may now delete the two rectangles that served as the template for the pattern).

10% popularity Vote Up Vote Down


 

@BetL875

If, like me, you're unable to use any extensions due to multiple incompatible python installations (not an uncommon problem) it's still possible, but best in a simple file (and much easier if you don't save optimised SVG,which you can't without extensions):


Set the pattern you want for the object you want
Save the file
Open it in a decent text editor (notepad++ works nicely on windows, especially if you tell it to use XML syntax highlighting for .SVGs).
Find the pattern definition near the top of the file (if you only have 1, search for "pattern").
Look for the next line with style="fill:????;stroke:????" /> (in my case fill:black).
Select down to the bottom of the pattern definition.
Find/replace all within selection: Find the original fill colour, replace with the new one, e.g. Find black, replace #808080 and you'll get grey.
Save and reopen in inkscape.
To attach the pattern color to a Swatch, replace the fill or stroke color value with the url syntax and the Swatch name. For example, create a swatch named Black then replace with fill:url(#Black) and the pattern's fill color will be tied to the Black Swatch, allowing easy updates in Inkscape.

10% popularity Vote Up Vote Down


 

@Voss6371140

The easiest way I figured out is probably this:


Draw a figure.
Select the pattern from Fill and Stroke ("Füllung und Kontur").
Click Extensions > Colour > Replace colour .. (should be something like Erweiterungen > Farbe > Farbe ersetzen in German).
Enter the hex code for your desired colour.


Another way:


Select Edit >> XML Editor.
Expand svg:defs >> svg:pattern id="Strips1_1".
Select svg:rect.
Click style.
Set fill to the RGB hex code (including the #).
Click Set to apply the changes.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme