
Changing fill and stroke color using a palette
In this recipe we will change the Fill and Stroke color of a rectangle using color chips from a palette.
Getting ready
Our currently selected palette is presented to us in a swatch panel, right under the Canvas.
Make sure that the Inkscape default color palette is chosen. You can select it by clicking the small, left pointing arrow button on the right-hand side of the swatch.
How to do it...
We shall see how to change the fill and stroke color of a rectangle in the following steps:
- Select the Rectangle tool (F4).
- Click and drag on the canvas to draw a rectangle. It will stay selected after you finish drawing.
- Click on a light red color chip of your choice to change the Fill color of the rectangle.
- Hold down the Shift key on your keyboard while clicking on a dark red color chip to change the Stroke color of the rectangle.
- Increase the stroke width so the stroke color change is more obvious. You can do that by using the stroke width box in the bottom left corner of the window. The number shown is the width of the stroke of the currently selected object. Right-click on it and select a value of 16.

How it works...
In vector graphics, almost all objects have a fill and a stroke, and their colors can be changed independently. We used a rectangle in this recipe, but the same applies to all vector objects in Inkscape. The easiest and fastest way to change the colors of an object is to use the palette swatch on the bottom of the screen.
Inkscape's default installation comes with a convenient set of popular color palettes, that can help in creating icons for a specific theme (Windows OS icons, Tango icons for various free and open-source GUIs) or working with the gray scale color model (as in the case of black and white photos or logos).
There's more...
Right-clicking on a color chip will pop up a selection menu where we can choose that color for either the fill or the stroke of the currently selected object. We can also drag the color directly on the objects in the canvas to color them, without first selecting them.
There is a convenient style indicator at the bottom-left of the Inkscape window that shows the color information of the selected object. This can sometimes be helpful when dealing with objects that are covered by others, so you can easily figure out which one is actually selected.
If more than one object is selected, average values are calculated and displayed.

In the top-right corner of the window there is a new style indicator that appears when you click on a tool, such as the Pen (Bezier) or the Rectangle tool, and there are no objects selected. It shows what style would be applied to a new object if you started drawing with the currently selected tool. By clicking (or holding Shift and clicking) on the palette chips when no object is selected you can set the object colors before you start drawing it.
Clicking on it will open the Inkscape Preferences window, where we can choose the default style for the different objects we will create.

Changing color using the Fill and Stroke dialogue window
Using palettes isn't the only way to change object colors. You will find a full set of options in the Fill and Stroke dialogue window (Shift + Ctrl + F), Menu | Object | Fill and Stroke or right-click and select Fill and Stroke), including several color pickers commonly found in graphics programs.
See also
For more information, refer to Creating your own custom color swatches and Creating your own color palette in Chapter 3, and also the rest of the material in this chapter.