-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Consider moving MAUI's Color type into the base .NET #16903
Comments
@aaronfranke (or others) - can you say more about how you personally would like to use this, perhaps describing the use case that led you to create this issue. Conceptually it makes sense, but understanding specific customer scenarios that would benefit from this can help us prioritize. |
I work on Godot Engine. We define our own Color type in C#. And Unity does too. And Stride does too. If I want to make a library that can be used in both Unity and Godot, I may require some Thankfully as of .NET Core 1.0 and .NET Standard 2.1+ C# provides There have been arguments against this because of the complexity of color spaces, but I think the existence of color spaces should not be a blocker to having a general-purpose The existence of a The API I propose in my proposal is very similar to the color types in Godot, Unity, MAUI, etc. I included Footnotes
|
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
Description
https://github.com/dotnet/maui/blob/main/src/Graphics/src/Graphics/Color.cs
This data type is highly useful and general. I would appreciate having it defined outside of MAUI so that many C# applications and libraries can use it as a data interchange type for floating-point RGBA colors.
Since Color is very similar in structure to other numeric types like Vector2, Vector3, etc, I would suggest adding it to the System.Numerics namespace in .NET.
See also these previous discussions:
Public API Changes
Immediately, nothing would change for MAUI. Long-term, MAUI would use the .NET Color type as a drop-in replacement for the current Color type, since it would be very similar (or identical) to the format already in MAUI.
Intended Use-Case
Interoperability between different C# applications and libraries to have one common Color type that can be used to transfer simple floating-point RGBA values in a standard format.
The text was updated successfully, but these errors were encountered: