Difference between revisions of "Creating a multicolor icon"

From Inkscape Wiki
Jump to navigation Jump to search
m (Next piece.)
 
(32 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This is a Guide for creating icon themes for Inkscape 1.0+
== What are multicolor icons? ==
== 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.
From Inkscape 1.0 on, Inkscape icon sets can make use of 3 user-customizable highlight colors, plus a user definable base color (colors can be mixed and blended). A user can select the colors in <code>Edit > Preferences > Interface > Theme: Display icons</code>.


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.
The stock multicolor icon theme was designed 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.
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. Instead, you can base your changes on an existing icon theme (hicolor or Multicolor).


== How does it work? ==
== 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.
Gtk supports up to 4 classes of colors: <code>.success</code>, <code>.warning</code> and <code>.error</code>. Normally, <code>.error</code> is set to red, <code>.warning</code> is orange and <code>.success</code> is green. The default colors can be set in a CSS file in the theme's folder. Inside this file also there is  <code>.base</code> color defined is foreground color and the background is transparent or widget background-color.


== How to build a new set of icons: Practical Guide ==
== How to build a new set of icons: Practical Guide ==
Line 15: Line 17:
==== Creating a new icon theme and setting its default colors ====
==== Creating a new icon theme and setting its default colors ====


# Find the '''Inkscape data folder''' at Edit > Preferences > System: Inkscape data.
# Find the '''Inkscape data folder''' at <code>Edit > Preferences > System: Inkscape data</code>.
# Find you '''Inkscape user icon folder''' at Edit > Preferences > System: User icons.
# Find you '''Inkscape user icon folder''' at <code>Edit > Preferences > System: User icons</code>.
# Open the folder 'icons' in the Inkscape data folder.
# Open the folder <code>icons</code> in the Inkscape data folder.
# Copy the 'multicolor' icon folder from there into your Inkscape user icon folder.
# Copy the <code>multicolor</code> icon folder from there into your Inkscape user icon folder. OR download from https://gitlab.com/inkscape/inkscape/-/tree/master/share/icons/multicolor
# Rename the new folder to your new name (for example, call it ''Super Cool Icons'').
# 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.
# Open the file <code>index.theme</code> in your new icon folder with a text editor (e.g. Notepad), and adjust the name and comment line there, too. Save the file.
# To set up your default colors:
# To set up your default colors:
## Open the file 'highlights.css' in your new 'Super Cool Icons' folder with your favorite text editor.
## Open the file <code>highlights.css</code> in your new <code>Super Cool Icons</code> folder with your favorite text editor be careful only touch the color definition and dont add extra spaces, new lines or reindent...
## 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.
## Adjust the hex color codes of the classes to your liking, e.g. if you want your <code>.success</code> class to be green, you will change it to <code>#009909</code>.
## You can copy hex colors from Inscape's Fill and Stroke dialog or use an online color chooser, e.g. https://htmlcolorcodes.com .
## 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.
## The <code>.dark</code> classes can be used to adjust your color scheme to dark themes.
## Save and close the 'highlights.css' file.
## Save and close the <code>highlights.css</code> file.
# You can also come back and tweak the colors later, if you like.
# You can also come back and tweak the colors later, if you like.


==== Editing or creating your first icon ====
==== Editing or creating your first icon ====


Now when you are happy with your colors, we can jump into Icon editing:
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.
# 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 any icon file in the folder <code>symbolic/actions</code> inside your <code>Super Cool Icons</code> folder with Inkscape 1.0.
# Open the dialog Object > Selectors and CSS.
# Open the dialog <code>Object > Selectors and CSS</code>.  
# Also open Edit > Preferences > Interface > Theme and select the icon theme you have just created.
# Also open <code>Edit > Preferences > Interface > Theme</code> and select the icon theme you have just created.
# Delete the current icon.
# Delete the current icon.
# Design your own icon.
# Design your own icon on the same layer.
# To assign a color to a fill:
# To assign a color to a fill:
## Select the path.
## 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).
## In the <code>Selectors and CSS</code> dialog, you will see 3 classes (<code>.success</code>, <code>.warning</code>, <code>.error</code>) (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.
## Click on the <code>+</code> button next to the desired class, e.g. if you want the fill to be green (<code>.success</code>), you will click on <code>+</code> button next to <code>.success</code>.
## 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.
## If you changed your mind and want a different class, you can click on the triangle behind the class name to expand the list of objects that use the class, and remove the class from the path by clicking on the <code>x</code> button.
# To preview your icon designs, save the icon file (Ctrl+S), and then toggle the box for the dark theme twice in the preferences to force a reload of the current theme.
## You need to add each path a class <code>.success</code>, <code>.warning</code>, <code>.error</code> trought XML Inspector
# Now you can see how they look when used in the Inkscape interface (note that this technique does not work for dock icons you need to restart inksacpe to see thees icons change )
# To preview your new icon, save the icon file (<code>Ctrl+S</code>), toggle the 'dark theme' option twice. This wil reload icons.
# Now do it 450 more times and you made '''SUPER COOL ICONS'''
# Now you can see how the icon looks when it is used in the Inkscape interface.
# Congratulation you did it dont forget to share your '''SUPER COOL ICONS''' theme with comunity on inkcape.org
# 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 [https://inkscape.org/gallery/=inkscape-gui-icon-set/ the Inkscape website].


== Feature support ==
== Feature support ==


==== Suported: ====
==== Supported: ====


* 4 colors + opacities of this colors (set by classes)
* 3 solid fill colors (set by classes) + 1 base color
* solid fills (set by classes)
* arbitrary opacity values (not alpha, but object opacity)
* LPE (life paths effects)
* LPEs (live path effects)
* Cliping masks
* clip masks
* Filters ( dont reccomend to us it )
* filters (not recommended, not change on dark/bright changes, resolution-dependent)
* Bitmaps embeds ( dont reccomend to us it )
* embedded bitmaps (not recommended, not change on dark/bright changes, resolution-dependent)


==== Unsuported: ====
==== Unsupported: ====


* strokes ( workaorund in [[##Tips%20and%20Tricks|Tips and Tricks]])
* strokes with any color different from the theme base color
* gradients ( workaorund in [[##Tips%20and%20Tricks|Tips and Tricks]])
** ''Workaround: add the 'Join type' LPE (it nondestructively converts strokes to paths)''
* gradients
** ''Workaround: you can simulate linear gradients by creating multiple 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 a radial gradient by adding circles increasing in size and decreasing in opacity. You can also simulate gradients by using blur on paths.''
* mesh gradients
* mesh gradients
* blend modes
* blend modes
* diffrent colors than set by clases ( .base, .danger, .warning, .danger) ( workaorund in [[##Tips%20and%20Tricks|Tips and Tricks]])
* different colors than those set by <code>.success</code>, <code>.warning</code> and <code>.error</code>.
** ''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 <code>.success</code> color.''
 
== Best practices ==


== Best technical practisies ==
* 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 (16x16px), so '''use a grid''' for drawing to ensure crisp rendering. It seems like you need to use a 24x24 grid for icons inside SOME panels (alignment and distribution).
* Add a color class to all paths, or unset the fill. If no class is set, the default class <code>.base</code> will be used.
* Try to keep the SVG file '''small and simple''' so it does not take a long time to render your icons (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.).
*keep 1 pixel safe zone in icons
*Use colors thematically :
** blue  - style and color mostly
** green - create form scratch/ highlighter / select
** pink  -  shape/type/ delete


<ul>
[[File:Icons on pixel grid.png]]
<li>Keep it all in one layer and DONT change name of layer</li>
[[File:Safe zones icons.png]]
<li>Keep in mind that this icons are going to be very small (16*16px) so use grid for chrisp rendering</li>
<li>Add color class to all paths If you cont defoult class is .base</li>
<li>Try to keep SVG small and simple so it does not take long time to render them (this can impact start up time )</li>
<li>Try use opacities 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, % to keep SVGs small</li>
<li>Try to use max 0.xx on in your cordinations ( nodes poritions , object transformations etc)</li>
== Tips and tricks ==
</li>
<li>to render Strokes add LPE Join paths ( It just nondestractivly convert strokes to paths )</li>
<li>you can create more than 4 colors by mixing 4 colors with opacity. Create duplicat of path you want to mix color add new color and change opaciy. Succes 100% + Base 50% for darker shade of Succes color</li>
<li>keep your icon folder in (WIN) C: '''YOUR USER NAME''' </li>
<li>You can set your defoult colors of '''normal theme''' and '''''dark theme''''' in '''highlights.css'''</li>
<li>you simulate linear gradients by creating buch of rectangles in row and changing their opacity (0,10,20,30...) and than clip this grupe with shape you want to make linear gradient</li>
<li>you simulate radial gradient by making circles goign from small to big and changing their opacity (0,10,20,30...) and cliping this grupe with shape you want to make linear gradient</li>
<li>you can simulate gradients by using blur on paths</li>
<li>to preview your icon designs live-ish keep preference panel ('''Edit/Preferences> Interface> Theming''') open in corener a SAVE ( ctrl+S ) and double click chcek box Dark theme this will reload Icons and you can see how they look (Note that this technique does not work for dock icons you need to restart ink to see changes)</li>
<li>you can ajust your color schem in dark mode by editing '''highlights.css''' dark.'''class name''' ( contras works diffrently on dark and white backround)</li>
<li>Have a fun</li></ul>

Latest revision as of 12:15, 20 September 2022

This is a Guide for creating icon themes for Inkscape 1.0+

What are multicolor icons?

From Inkscape 1.0 on, Inkscape icon sets can make use of 3 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 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. Instead, you can base your changes on an existing icon theme (hicolor or Multicolor).

How does it work?

Gtk supports up to 4 classes of colors: .success, .warning and .error. Normally, .error is set to red, .warning is orange and .success is green. The default colors can be set in a CSS file in the theme's folder. Inside this file also there is .base color defined is foreground color and the background is transparent or widget background-color.

How to build a new set of icons: Practical Guide

Creating a new icon theme and setting its default colors

  1. Find the Inkscape data folder at Edit > Preferences > System: Inkscape data.
  2. Find you Inkscape user icon folder at Edit > Preferences > System: User icons.
  3. Open the folder icons in the Inkscape data folder.
  4. Copy the multicolor icon folder from there into your Inkscape user icon folder. OR download from https://gitlab.com/inkscape/inkscape/-/tree/master/share/icons/multicolor
  5. Rename the new folder to your new name (for example, call it Super Cool Icons).
  6. Open the file index.theme in your new icon folder with a text editor (e.g. Notepad), and adjust the name and comment line there, too. Save the file.
  7. To set up your default colors:
    1. Open the file highlights.css in your new Super Cool Icons folder with your favorite text editor be careful only touch the color definition and dont add extra spaces, new lines or reindent...
    2. 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.
    3. You can copy hex colors from Inscape's Fill and Stroke dialog or use an online color chooser, e.g. https://htmlcolorcodes.com .
    4. The .dark classes can be used to adjust your color scheme to dark themes.
    5. Save and close the highlights.css file.
  8. 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:

  1. 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.
  2. Open any icon file in the folder symbolic/actions inside your Super Cool Icons folder with Inkscape 1.0.
  3. Open the dialog Object > Selectors and CSS.
  4. Also open Edit > Preferences > Interface > Theme and select the icon theme you have just created.
  5. Delete the current icon.
  6. Design your own icon on the same layer.
  7. To assign a color to a fill:
    1. Select the path.
    2. 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).
    3. 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.
    4. If you changed your mind and want a different class, you can click on the triangle behind the class name to expand the list of objects that use the class, and remove the class from the path by clicking on the x button.
    5. You need to add each path a class .success, .warning, .error trought XML Inspector
  8. To preview your new icon, save the icon file (Ctrl+S), toggle the 'dark theme' option twice. This wil reload icons.
  9. Now you can see how the icon looks when it is used in the Inkscape interface.
  10. Repeat the process 450 more times to finish your very own Super Cool Icons.
  11. Congratulation you did it! Dont forget to share your Super Cool Icons theme with the community on the Inkscape website.

Feature support

Supported:

  • 3 solid fill colors (set by classes) + 1 base color
  • arbitrary opacity values (not alpha, but object opacity)
  • LPEs (live path effects)
  • clip masks
  • filters (not recommended, not change on dark/bright changes, resolution-dependent)
  • embedded bitmaps (not recommended, not change on dark/bright changes, resolution-dependent)

Unsupported:

  • strokes with any color different from the theme base color
    • Workaround: add the 'Join type' LPE (it nondestructively converts strokes to paths)
  • gradients
    • Workaround: you can simulate linear gradients by creating multiple 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 a radial gradient by adding circles increasing in size and decreasing in opacity. You can also simulate gradients by using blur on paths.

  • mesh gradients
  • blend modes
  • different colors than those set by .success, .warning and .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.

Best practices

  • 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 (16x16px), so use a grid for drawing to ensure crisp rendering. It seems like you need to use a 24x24 grid for icons inside SOME panels (alignment and distribution).
  • 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 your icons (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.).
  • keep 1 pixel safe zone in icons
  • Use colors thematically :
    • blue - style and color mostly
    • green - create form scratch/ highlighter / select
    • pink - shape/type/ delete

Icons on pixel grid.png Safe zones icons.png