This is what really annoys me in Breeze Icons: We are adding icons to icons-dark/ although they are almost exact copies of the icons in icons/. That means double file hazzle.
I’ve got a list of icon files in icons-dark/, which do not exactly look like the ones from icons/ after simple color substitution. There are 319 such icons, which is less than 10%.
To reproduce and check, I am leaving the script here.
change-to-dark.pl contains 4 very simple color substitutions. It should be no problem to implement them in the Breeze Icons build process.
- Clone breeze-icons
- Copy icons/ and icons-dark/ to a new folder
- Do color substitution on all icons in icons/:
$ ./change-dir-to-dark.pl icons/
- (Optional) Modify some icons in icons/, to see that compare-light-dark.pl works as expected. I let actions/16/accept_signal.svg be modified.
- (Optional, for clarity) Rename icons/ to icons-dark_generated/, and icons-dark to icons-dark_original/
- Compare the original icons with the generated icons (order is important!):
$ ./compare-light-dark.pl icons-dark_original/ icons-dark_generated/ >icons-with-differences.txt
- This will tell you that there are 319 (+ the modified ones) icons which can not be reproduced exactly by swapping the color codes. It will also tell you that 0 icons in icons-dark/ have no partner in icons/.
- To see which icons in icons/ have no partner in icons-dark/, remove the compare call in compare-light-dark.pl (and optionally the symlink check), and call it with reverse argument order.
- This will tell you that there are 93 icons in icons/ but not in icons-dark/.
Description:
- change-to-dark.pl replaces all #c0ffee style color codes. It is based on https://community.kde.org/Guidelines_and_HOWTOs/Icon_Workflow_Tips and icons-dark/light2Dark.
- change-dir-to-dark.pl traverses the directory tree of icons/, skips all files and directories which are symlinks, and calls change-to-dark.pl on the icon files. It is important to skip symlink directories, otherwise icon files are modified twice, and colors are swapped twice. It is important to skip symlink files, otherwise symlinks will be replaced by actual files (and sometimes colors are swapped twice again).
- compare-light-dark.pl traverses the directory three of icons-dark/ the same way, and looks for each icon file whether it has a “partner” in icons/. If it has, it compares them with ImageMagick compare.
- compare-light-dark.pl needs the perl module Term::ProgressBar, because it needs very much time to complete. If you don’t need that, because you don’t have such a slowbook like me, you can remove the respective code lines.
- compare-light-dark.pl needs the perl module Capture::Tiny.
Now my suggestions are these tasks:
- Revise the remaining 319 icons, and decide which really need their own dark version. Would make sense to write a script to call montage-breeze, montage-breeze-dark, and montage with these icons.
- Extent the build process to copy icon files from icons/ to icons-dark/ if there isn’t already a file in icons-dark/, and swap their color codes.
Complaints?