PDFsharp
PDFsharp copied to clipboard
Color.Parse() throws ArgumentException
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.
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.
Fix is coming with version 6.2.0 Preview 3.