Make gradient nodes "change places?"

Post questions on how to use or achieve an effect in Inkscape.
linebender
Posts: 57
Joined: Fri Feb 11, 2011 3:46 am

Make gradient nodes "change places?"

Postby linebender » Fri Sep 09, 2011 3:30 am

Let's say you have a gradient in which the stops are:


Red Black Gray Yellow

and you want to change the order of those stops to:

Yellow Red Black Gray


Can you do so by moving the stops with the cursor some how? or do you have to change the color of each node, one at a time, to achieve the new order you desire?

I've tried it by moving the stops, as you can do in Illustrator, but they don't seem to want to go past any other stop they encounter, no matter what key combo I try.

thanks for any insight!

lb

Pesho
Posts: 10
Joined: Sat Sep 27, 2008 9:44 pm

Re: Make gradient nodes "change places?"

Postby Pesho » Fri Sep 09, 2011 4:05 am

Have you tried the gradient tool ( :tool_gradient: )?

linebender
Posts: 57
Joined: Fri Feb 11, 2011 3:46 am

Re: Make gradient nodes "change places?"

Postby linebender » Fri Sep 09, 2011 4:10 am

yes. that's precisely the tool where I've tried to drag the stops to where I want them and they don't want to pass beyond other stops that are in the way of where I want to drag them to.

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

Re: Make gradient nodes "change places?"

Postby ~suv » Fri Sep 09, 2011 4:13 am

To revert a gradient:
  1. select object(s)
  2. switch to the gradient tool (keyboard shortcut G)
  3. and then use the keyboard shortcut Shift+R.
If the selected object has two gradients defined (for both the fill and the stroke), or if you have multiple objects selected when switching to the gradient tool, by default all gradients are reverted. If you select one of the gradient stops of one (or multiple) of the gradients with the gradient tool, the command will only apply to the selected gradient(s).

Note that this command (Shift+R) is only available inside the gradient tool context [1] (the gradient editing features within other tool contexts are limited) and there is no button for it to make it available globally, e.g. in the 'Fill & Stroke' dialog.

[1] I'm emphasizing this because many users initially confuse the gradient tool (on-canvas creating and editing of gradients) either with the node tool/shape tools (which can optionally show gradient handles and allow adjusting the positions of the stops) or with the gradient editor (floating dialog to select/adjust individual stops and their offsets, as well as the color and transparency). The gradient editor dialog is deprecated and is planned to be replaced by merging its features into the controls bar of the gradient tool.

linebender
Posts: 57
Joined: Fri Feb 11, 2011 3:46 am

Re: Make gradient nodes "change places?"

Postby linebender » Fri Sep 09, 2011 4:59 am

thank you.

yes, I was using the gradient tool (keyboard shortcut g) and I can not achieve what I am asking about with it.

perhaps it is not possible in inkscape at this time?

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

Re: Make gradient nodes "change places?"

Postby ~suv » Fri Sep 09, 2011 5:26 am

linebender wrote:yes, I was using the gradient tool (keyboard shortcut g) and I can not achieve what I am asking about with it.

Does the keyboard shortcut 'Shift+R' work if you close the 'Fill & Stroke' dialog first?

Steps:
  1. select the object whose gradient you want to revert
  2. switch to the gradient tool ('G')
  3. close any docked dialogs (especially the 'Fill & Stroke' dialog), or make sure that the focus is on the canvas and not in the docked dialog
  4. use the command to revert the gradient: 'Shift+R'

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Make gradient nodes "change places?"

Postby brynn » Fri Sep 09, 2011 5:38 am

The only way I've found to do what you're asking (which is not exactly reversing the gradient) is to copy/paste the color codes from the Gradient Editor (or Fill/Stroke dialog).

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

Re: Make gradient nodes "change places?"

Postby ~suv » Fri Sep 09, 2011 5:40 am

linebender wrote:thank you.

yes, I was using the gradient tool (keyboard shortcut g) and I can not achieve what I am asking about with it.

perhaps it is not possible in inkscape at this time?

Sorry - my mistake :oops: (I need to read the questions more carefully - you don't want to simply revert the gradient).
linebender wrote:Let's say you have a gradient in which the stops are:
    Red Black Gray Yellow
and you want to change the order of those stops to:
    Yellow Red Black Gray

No, this is not possible by dragging the stops on-canvas or the offset slider in the gradient editor. You have to change the color of each stop individually (using the gradient tool on-canvas, or the gradient editor dialog). Mid-stops cannot be dragged beyond adjacent stops.

linebender
Posts: 57
Joined: Fri Feb 11, 2011 3:46 am

Re: Make gradient nodes "change places?"

Postby linebender » Fri Sep 09, 2011 6:46 am

OK...good to have the information; sad the answer is no.

and yes, Shift-R does "reverse" the gradient for me.

SO...for inkscapers who DO want to make color stops in gradients change places they're stuck wtih making new colors for each..are there plans to make it so that you can move stops beyond adjacent stops?

lb

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: Make gradient nodes "change places?"

Postby Xav » Fri Sep 09, 2011 9:14 pm

There is a faster option than copying/pasting colour codes in the gradient dialogue - that is to copy/paste the colours from the on-canvas stops directly. Hopefully this will explain what I'm talking about:

1) Create a wide rectangle filled with your gradient
2) Duplicate it and move the dupe down so that you can easily get to both of them
3*) Select the second rectangle, and in the Fill/Stroke dialogue click the Duplicate button so that you've got two identical gradients, one on each rect
4) Select the :tool_gradient: tool and click on the top (source) rectangle. You should see the gradient stops.
5) Click on the gradient stop that represents the one you want to appear first in the new gradient, so that the node becomes highlighted.
6) Press Ctrl-C (Apple-C). This will copy the node's colour to the clipboard.
7) Click on the bottom (destination) rectangle, then select the first stop of the gradient so that the node becomes highlighted
8 ) Press Ctrl-V (Apple-V) to paste the colour from the clipboard to that stop
9) Repeat for each subsequent stop, copying the colour from the source gradient and pasting it onto the correct stop of the destination gradient
10) Finally you can delete your rectangles and use your new gradient. If nothing is using the old one when you've finished then File=>Vacuum Defs should remove it (don't do this until at least one object is using the new gradient, or you'll lose that too!)


It may sound like a lot of steps, but give it a try and I think you'll find it's actually quite a fast process (though not as fast as just dragging the stops would be).



* Note that step 3 is only needed if the Inkscape pref "Prevent sharing of gradient definitions" (in the Misc section) is unchecked. If it's checked, then a second gradient copy will be created as soon as you edit any of the stops anyway. If in doubt, perform step 3 anyway as it won't do any harm.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Make gradient nodes "change places?"

Postby druban » Fri Sep 09, 2011 9:30 pm

Similar to Xav's method, just working without a duplicate object:
1. Click on the node you want to drag.
2. Copy that node's color to the clipboard.
3. Double-click with the gradient tool on your gradient where you want to drag your node to, This creates a new node with a colour exactly the same as the gradient under it.
4. Click on this new node to select it, and then paste the colour from the clipboard.
5. Go back and delete the original node with ctrl+alt.
Your mind is what you think it is.

linebender
Posts: 57
Joined: Fri Feb 11, 2011 3:46 am

Re: Make gradient nodes "change places?"

Postby linebender » Fri Sep 09, 2011 11:52 pm

thank you both..those sound like excellent methods!

lb


Return to “Help with using Inkscape”