-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Texture2D "convert_colors_with_editor_theme" import flag seems to do nothing #67929
Comments
The most likely culprit is the format in which the colors are stored. The system for color replacement in SVGs in the Godot editor is very rudimentary and doesn't work with arbitrary SVGs. It looks specifically for attributes, expressed like this: if (p_color_map.size()) {
_replace_color_property(p_color_map, "stop-color=\"", p_string);
_replace_color_property(p_color_map, "fill=\"", p_string);
_replace_color_property(p_color_map, "stroke=\"", p_string);
} It seems your icons have colors inside of the This is something that we would need to improve upon in future, and something that we want to document, alongside our color map itself, in the meantime. But for the time being you need to save your icons the same way you'd save them if you were contributing them to the project itself. |
Following the documentation I found there: <svg height="16" viewBox="0 0 4.2333332 4.2333335" width="16" xmlns="http://www.w3.org/2000/svg">
<path d="m3 0c-.5539988 0-1 .44600109-1 1v13c0 .554.4460012 1 1 1h5.0000001 4.9999999c.553999 0 1-.446001 1-1v-4.9999999-8.0000001c0-.55399891-.446-1-1-1zm0 1h10v1h-10zm0 2h10v1.0000001h-10zm0 2.0000001h10v1h-10zm0 2h10v1h-10zm0 2h5.0000001 1.9999999 1 2v.9999999h-4.9999999-5.0000001zm0 1.9999999h5.0000001 4.9999999v1h-4.9999999-5.0000001zm0 2h5.0000001 4.9999999v1h-4.9999999-5.0000001z" fill="#e0e0e0" fill-rule="evenodd" stroke-dashoffset="4.2" stroke-linecap="square" stroke-width="2.5" transform="scale(.26458333)"/>
<path d="m2.38125 2.116667h1.058333v.79375h-1.058333z" fill="none"/>
</svg> And even when I re-import with the flag set to off, then back to on, then reload the editor (Godot 4.0 Beta 5 as of now) nothing changes. I understand the expected constraints and I'm more than happy to work with those! No big deal when it's for a niche purpose such as this. I just still seem to be getting something wrong… |
I'm seeing the same thing, but scaling is affected too. Oddly enough, both scale and color conversion is applied in the icon's thumbnail in the FileSystem dialog, but not in the SceneTree or in the list of nodes when adding a new node. I had to run the icons through I also notice that the editor's current scale and color theme are stored in those icons' corresponding (at first I accidentally commented this on the merge request linked in the OP, like the fool I am. Whoops 😛 sorry if I annoyed anyone!) |
This oversight has been reported already, there is a PR: #75949
Both tweaks are applied upon the import, not upon usage. Everything uses the same texture, so you shouldn't see any differences. Unless you change something, then you might need to manually hit the Reimport button or restart the editor. There are also some issues with the editor support of icons for custom types, but it should be fixed in 4.1: #75472 |
I just compiled Godot on the master branch and tried it out, and can confirm that I'm not seeing the problem anymore. All custom class icons work perfectly, colors and scaling are adjusted flawlessly. It's such a nice feeling when you learn a bug was fixed before you even get the chance to notice it, and when the project's development is transparent enough for that to happen :) Thanks for the great work and for the quick response! |
Godot version
4.0 beta 3
System information
Linux Manjaro 6.0.3 (KDE Plasma 5.26.1 X11), AMD Ryzen 2500U, Radeon Vega 8
Issue description
I'm working on an editor plugin which adds various controls and types, all with their own svg icons. I follow the same color palette used by Godot's own icons and have turned on the
scale_with_editor_scale
andconvert_colors_with_editor_theme
flags from this merged pull request before re-importing all those icons. While the icons do scale up properly when I change the editor's scale (200% looks hilarious on my 1080p monitors) the colors don't change as they should when I switch between light and dark modes, whether the icon is given to an editor button, added in a class description with[img]
or used as a class icon with@icon
. Even when restarting the editor either with a dark or light icon theme. I've also tried borrowing Dialogic's own icon to see if I was doing something wrong on that end and it didn't work either.Steps to reproduce
Create a project and give it plugin buttons or classes with a properly imported (With
convert_colors_with_editor_theme
set to true) svg icon following the proper color palette, then alternate between dark and light modes. The attached reproduction project has just that.Minimal reproduction project
Icons_64938.zip
The text was updated successfully, but these errors were encountered: