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

C#: Synchronize Color with Core #69867

Merged
merged 1 commit into from
Dec 16, 2022
Merged

Conversation

raulsntos
Copy link
Member

@raulsntos raulsntos added this to the 4.0 milestone Dec 10, 2022
@raulsntos raulsntos requested review from a team as code owners December 10, 2022 18:51
@@ -597,7 +643,7 @@ public Color(string code, float alpha)
/// <exception name="ArgumentOutOfRangeException">
/// <paramref name="rgba"/> color code is invalid.
/// </exception>
private static Color FromHTML(ReadOnlySpan<char> rgba)
public static Color FromHTML(ReadOnlySpan<char> rgba)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to also implement an overload that takes String for .NET languages that don't support Spans (I think F# supports them, so it's probably only VB).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't they support spans? And not even for casting from a string?

Copy link
Member Author

@raulsntos raulsntos Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because, AFAIK, VB doesn't support ref structs so the method can't be called.

- Add `Luminance` readonly property.
- Add `LinearToSrgb` and `SrgbToLinear` static methods.
- Add `FromOkHsl` static method.
- Add `FromRgbe9995` static method.
- Add `FromString` static method.
- Expose `FromHtml` static method.
- Expose `HtmlIsValid` static method.
- Add and update some Color documentation.
@raulsntos
Copy link
Member Author

Removed OkColor.cs C# implementation in favor of using interop to re-use ok_color.h for the implementation of Color.FromOkHsl.

@neikeq neikeq merged commit df0cf08 into godotengine:master Dec 16, 2022
@neikeq
Copy link
Contributor

neikeq commented Dec 16, 2022

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants