Creating a multicolor icon
What are multicolor icons?
From Inkscape 1.0 on, Inkscape icon sets can make use of 4 user-customizable highlight colors, plus a user definable base color (colors can be mixed and blended). A user can select the colors in Edit > Preferences > Interface > Theme: Display icons.
The stock multicolor icon theme was designed and documented by Adam Belis. Most of its icons are based upon those contained in the hicolor symbolic icon theme.
Since Inkscape's switch to Gtk3, every icon is saved in a separate file. There are about 450 different icons used in Inkscape. When you're creating your own icon theme, you don't need to make a new one for each of those, but can base your changes on an existing icon theme.
How does it work?
Gtk supports up to 4 classes of colors: .base, .success, .warning and .error. Normally, .error is set to red, .warning is orange and .success is green. .base is black and the background is white (transparent?). The default colors can be set in a CSS file in /share/inkscape/icons/<theme_name>/highlights.css.
How to build a new set of icons: Practical Guide
Creating a new icon theme and setting its default colors
- Find the Inkscape data folder at Edit > Preferences > System: Inkscape data.
- Find you Inkscape user icon folder at Edit > Preferences > System: User icons.
- Open the folder 'icons' in the Inkscape data folder.
- Copy the 'multicolor' icon folder from there into your Inkscape user icon folder.
- Rename the new folder to your new name (for example, call it Super Cool Icons).
- Open the file index.theme in your new icon folder with a text editor (e.g. Notepad), and adjust the name and comment there, too. Save the file.
- To set up your default colors:
- Open the file 'highlights.css' in your new 'Super Cool Icons' folder with your favorite text editor.
- Adjust the hex color codes of the classes to your liking, e.g. if you want your .success class to be green, you will change it to #009909.
- You can copy hex colors from Inscape's Fill and Stroke dialog or use an online color chooser, e.g. https://htmlcolorcodes.com .
- The .dark classes can be used to adjust your color scheme to dark themes.
- Save and close the 'highlights.css' file.
- You can also come back and tweak the colors later, if you like.
Editing or creating your first icon
Now when you are happy with your colors, we can jump into Icon editing:
- Think about how you want to use the three available colors for your theme, e.g. maybe you want to sort icons by functionality, placement, or any other attribute.
- Open any icon file in the folder 'symbolic/actions' inside your 'Super Cool Icons' folder with Inkscape 1.0.
- Open the dialog Object > Selectors and CSS.
- Also open Edit > Preferences > Interface > Theme and select the icon theme you have just created.
- Delete the current icon.
- Design your own icon.
- To assign a color to a fill:
- Select the path.
- In the Selectors and CSS dialog, you will see 3 classes (.success, .warning, .error) (you may need to expand the dialog, or switch to vertical mode to be able to see them).
- Click on the + button next to the desired class, e.g. if you want the fill to be green (.success), you will click on + button next to .success.
- If you changed your mind and want a different class, you can click on the triangle to expand the list of paths that use the class, and remove the class from the path by clicking on the x button.
- To preview your new icon, save the icon file (Ctrl+S), and switch to a different theme, and then back to your new theme in the preferences to force a reload of the current theme.
- Now you can see how the icon looks when it is used in the Inkscape interface.
- Repeat the process 450 more times to finish your very own Super Cool Icons.
- Congratulation you did it! Dont forget to share your Super Cool Icons theme with the community on the Inkscape website.
- 4 solid fill colors (set by classes)
- arbitrary opacity values (not alpha, but object opacity)
- LPEs (live path effects)
- clipping masks
- Filters (not recommended)
- embedded bitmaps (not recommended)
- strokes with any color different from the theme base color
- Workaround: add the 'Join type' LPE (it nondestructively converts strokes to paths)
- Workaround: you can simulate linear gradients by creating a bunch of rectangles in a row and changing their opacity (0,10,20,30...), and then clipping this group with the shape you want to have a linear gradient. You can simulate radial gradients by using blur on paths.
- mesh gradients
- blend modes
- different colors than those set by .success, .warning, .error.
- Workaround: you can create more than 4 colors by layering objects with lowered opacity. Create a duplicate of the path, then change the new path's opacity and select one of the color classes. E.g. use one object with the class .success at 30% opacity, placed on top of another object with an unset fill for a different shade of the .success color.
- Keep it all in one layer and do not change the name of the layer.
- Keep in mind that the icons are going to be very small (16 x 16px), so use a grid for drawing to ensure crisp rendering.
- Add a color class to all paths, or unset the fill. If no class is set, the default class .base will be used.
- Try to keep the SVG file small and simple so it does not take a long time to render them (this can impact start up time).
- Try to use discrete opacity values: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100% to keep the SVG files small.
- Use a low precision for your file's coordinates (maximally 0.xx). This includes node poritions, object transformations etc.).