Linear gradient behavior when applied to lines

Post questions on how to use or achieve an effect in Inkscape.
Arc_Light

Linear gradient behavior when applied to lines

Postby Arc_Light » Thu Jan 13, 2011 2:49 pm

Hi all,

Am using Inkscape 0.48.0 r9654 on WinXP and running into an issue that I'm hoping someone can help out with. I have a number of straight lines of various orientations. I want to apply a linear gradient to them, and I want to have the linear gradient exactly congruent to the line itself - that is, the gradient should start at one end of the line and end at the other.

Inserting the linear gradient is fine, but Inkscape defaults to a horizontal linear gradient no matter what. For vertical lines, this looks totally stupid - my lines are 4 pixels wide so you can barely see this, basically it makes them look a bit thinner and blurry on one side. More generally, for everything but horizontal lines it means I have to go in and manually drag the gradient nodes to where I want them. Worse yet, there is no "snap to shape" feature I have located that lets me position the gradient node right at the end of the line, so if I want to be precise this ends up being incredibly tedious :x

Surely what I want to do should not be this painful; what am I missing? Thanks in advance,

Arc_Light

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: Linear gradient behavior when applied to lines

Postby prkos » Thu Jan 13, 2011 9:32 pm

You should be able to snap the gradient handle to the nodes, make sure you have snapping enabled, and snapping to and from nodes options are enabled, or maybe snapping to the bounding box can also help.

Create one line with the gradient, then duplicate it or even clone if you expect them to remain the same later, make sure the Move gradients with objects is turned on (Selector toolbar), and move the lines away, rotate them and resize, the gradients will follow the lines as expected.

Not sure if this can help you but sometimes it's easier to deal with rectangles instead of lines.
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: Linear gradient behavior when applied to lines

Postby chriswww » Thu Jan 20, 2011 10:43 pm

personally i prefer that inkscape keep things fairly generic like it is. if you make a tool work only in your style preference, then it probably will not be useful in other situations. and too much bloat of options and preferences for every tool just makes inkscape then more complicated to learn.
i'm no expert by any means, but after having gone through the inkscape tutorials and some online tips/tricks, you'll have a fair idea of how to achieve most things using current inkscape features.
if you post a picture of finished or work in progress, maybe someone will suggest an alternative that works much better for you. maybe tiled clones or even a semi-transparent overlay with circular gradient (overlaying all lines) would work?


Return to “Help with using Inkscape”