-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Rename color constants (alternative) #45144
Conversation
8552854
to
aca6ff5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this looks good to me, awesome work!
As for the conflicting color names listed in the OP, IMO all are good as they are in this PR, but ("Seashell" and "SEASHELL") vs ("SeaShell" and "SEA_SHELL") should be up to the community. To me neither is obviously better, and these conflict between the X11 and .NET color names. If I had to pick one, "Seashell" seems quite common, and it's not the color of a shell over the sea (but rather shells of animals in the sea) so I guess that's an argument against "Sea Shell".
Named color constants renamed to UPPERCASE. Unlike godotengine#41019, this PR is complete and implements these changes in the simplest way possible. Co-authored-by: Shivam Mukherjee <mshivam98@gmail.com>
aca6ff5
to
a97f1a3
Compare
I think we should follow X11 fully (the only exception is the added |
Thanks! |
Named color constants renamed to UPPERCASE. Unlike #41019, this PR
is complete and implements these changes in the simplest way possible.
I believe the underscores issue was solved quite elegantly (without introducing an extra function as in the original PR). I didn't even have to modify the
variant_call.cpp
file. And it works correctly.Also, I compared the naming in different places and filled this into a table (color_consts.ods.zip). It remains to resolve the following naming conflicts (we have to decide who we give preference to, MS or X11):
BURLY_WOODBURLYWOODBurlyWoodBurlywood.NETX11Details
The difficulty is that we have taken these names from two sources. There is no color in MS documentation for
REBECCA_PURPLE
,WEB_GRAY
,WEB_GREEN
,WEB_MAROON
,WEB_PURPLE
, there is no colorTRANSPARENT
in the Wikipedia page. In theory, the wiki page takes precedence, but in C# some color names are spelled differently. The question is what we should be compatible with. In my opinion, internal compatibility is more important than compatibility with the standard C# class.I think we should adhere to the following naming scheme:
Color.LIGHT_SEA_GREEN
— constant in GDScript.Colors.LightSeaGreen
— constant in C#.Light sea green color.
— description of the constant in the docs.Therefore, if the documentation says "Seashell color.", Then the constant should be named
Color.SEASHELL
in GDScript andColors.Seashell
in C#. Otherwise, the description should be "Sea shell color." and the constant should be namedColor.SEA_SHELL
andColors.SeaShell
.@aaronfranke Could you review this, please?