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

Color.Parse() throws ArgumentException #170

Open
Neralem opened this issue Sep 9, 2024 · 1 comment
Open

Color.Parse() throws ArgumentException #170

Neralem opened this issue Sep 9, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Neralem
Copy link

Neralem commented Sep 9, 2024

Color color = Color.Parse("#2F5C3A");
Does produce an ArgumentException "Requested value '#2F5C3A' was not found."
This Exception seems to be handled somewhere but slows down the code a lot. The color is parsed correctly though.

Expected Behavior

Should parse the color without throwing any Exceptions if the format is valid.

Actual Behavior

Always throws an ArgumentException.

Steps to Reproduce the Behavior

Create a new .Net 8 Console Application and try to parse a color from a hex string as I did.

@ThomasHoevel ThomasHoevel added the enhancement New feature or request label Sep 9, 2024
@ThomasHoevel
Copy link
Member

We'll discuss if this can be improved with MigraDoc 6.2.

Color.FromArgb or Color.FromRgb can be used instead of Color.Parse to avoid the exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants