Symbolic Icons / SVG Icons that get recoloured

David Edmundson davidedmundson at kde.org
Thu Mar 21 14:20:05 UTC 2019


> and we cannot change that for GTK 3. For GTK 4 it would be possible to add more colors, but the API would get pretty busy.
>

That's fine, I can't do all the changes I want till Qt6 either.
It's a good time for aligning as we both have API breaks coming up in
the next few years.

> Additionally, we use SVG recoloring as a fallback path, given the cost of loading SVG icons all over the place, and the optional dependency on librsvg; we generate pre-sized, recolored variants of the SVG icons re-encoded as specially crafted PNG files at build time for the assets that GTK itself ships:
>
You shipping a build-time cache alongside the SVGs would be fine.

Adwaita icons used in our software will get rendered correctly from the SVG
Breeze icons on GTK would hit your fallback path and get rendered correctly.

If it's a full replacement for the SVG icons, that would indeed be problematic.

>>  - apply SVG CSS injection to include non-symbolic icons. On icons
>> that don't end in "-symbolic" we should set the foreground colour on
>> the .fg class not to all SVG paths
>
>
> The API for loading non-symbolic assets does not take colors, so we cannot apply a style class.
>

You mean the *current* API for loading non-symbolic assets does not
take colours :)

I've filed a GTK bug report: https://gitlab.gnome.org/GNOME/gtk/issues/1762
but I'd appreciate it if we could keep discussion about anything
cross-desktop here.

David


More information about the xdg mailing list