Every gradient has a set of stops, each with its own color and transparency value. The minimum number of stops is the two end stops, in which case they apply to the ends of the gradient line (linear) or to the center and edges of an ellipse (elliptic). However, a gradient can also have any number of middle stops, each one having, along with its own color and transparency, a certain position between the end stops (for example, a middle stop may be at 0.5 of the gradient—that is, exactly in the middle between the end stops). For each gradient, the full set of its stops with their colors, transparencies, and positions is called the gradient definition.
Gradient definitions are document-wide resources. This means that any gradient you create or edit adds its definition to the list of all gradient definitions in the document. After that, you can assign that definition not only to the original gradient but to any other gradient in this document. The drop-down list in the controls bar of the Gradient tool displays swatches for all gradient definitions in the document:
The same list of gradient swatches is available in the Fill and Stroke dialog. When you have one or more objects with gradients selected, choosing a definition from the list will assign it to all selected gradients. This does not change the position of the end handles, but replaces the colors and may add or remove middle stops.
As of this writing, there’s no way to save and reuse gradient definitions across documents, but this is planned for a future release. Also, there is no way to rename a gradient from its default numeric name (other than by using the XML Editor).
You can reverse the color definition of the selected object’s gradient by pressing . For example, if you have an elliptic gradient with opaque blue in the center and transparent yellow at the edge, after pressing
you will have transparent yellow in the center and opaque blue at the edge. (With a linear gradient, this is equivalent to rotating the gradient line by 180 degrees, but an elliptic gradient can’t be reversed simply by moving its handles, which makes
especially useful.)
By the way, if you want to change the opacity of all stops in a gradient by the same amount, you don’t need to tweak the opacity of each stop separately. Instead, simply adjust the master opacity of the object that is using the gradient (8.1.2 Opacity).
When copying and pasting or duplicating an object with gradient, the object’s copy automatically gets a copy of the original gradient, so that modifying it does not affect the source object’s gradient definition. This behavior is controlled by the Prevent sharing of gradient definitions checkbox on the Misc tab of the Inkscape Preferences dialog. It is checked by default; if you uncheck it, then copying and pasting, duplicating, pasting style, and explicit assignment of an existing gradient definition to an object via the Gradient tool controls will result in a shared gradient definition. When two objects share a gradient definition, changing the colors or middle stop positions of the gradient on one object (but not changing the coordinates of the end handles) affects all the other objects that use the same definition.
The Vacuum Defs command in the File menu removes, among other things, any leftover unused gradient definitions that may be lingering in your document. It’s a good way to tidy things up and reduce the document size a bit.