Skip to content
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

Conversion to 4.0 doesn't change hex string to RGBA in Color constructor #73633

Closed
Tracked by #73960
pattlebass opened this issue Feb 20, 2023 · 0 comments · Fixed by #74026
Closed
Tracked by #73960

Conversion to 4.0 doesn't change hex string to RGBA in Color constructor #73633

pattlebass opened this issue Feb 20, 2023 · 0 comments · Fixed by #74026

Comments

@pattlebass
Copy link
Contributor

pattlebass commented Feb 20, 2023

Godot version

4.0.dev.dfdda9629

System information

Windows 10

Issue description

The way Godot parses hex Color strings is different in 4.0 (ARGB vs RGBA).

HEX string Godot 3 Godot 4
00FFFFFF Color(1,1,1,0) Color(0,1,1,1)
0FFF Color(1,1,1,0) Color(0,1,1,1)

I think the project converter can look for the Color constructor and modify the string.
Something along the lines of /Color\("#?([a-fA-F0-9]{8}|[a-fA-F0-9]{4})"\)/gm.

Also, exported colors seem to reset their value because of an "@" in the tscn file. (@exported_color instead of exported_color)

Steps to reproduce

  1. Open MRP in Godot 3 and look at output.
  2. Upgrade the project using the conversion tool.
  3. Open it in Godot 4 and notice how the colors are now totally different.

Minimal reproduction project

color_conversion.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants