Hi,
The following Aspose.Cells code throws an error.
The cause is the color:inherit
part of the HTML
var xls = new Workbook();
var sheet = xls.Worksheets.First();
var row = sheet.Cells.Rows[0];
row[0].HtmlString = @"<span style=""color:#ff0000;"">TEST</span>"; // OK
row[1].HtmlString = @"<span style=""color:inherit;"">TEST</span>"; // <---- Error
The error is:
.(S.(S.(S.(S.(S.(SUnhandled exception. System.ArgumentException: Convert invalid primitive (Parameter 'text') (Parameter 'htmlColor')
---> System.ArgumentException: Convert invalid primitive (Parameter 'text')
---> System.FormatException: The input string 'inherit' was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, ReadOnlySpan`1 value, TypeCode type)
at System.Int32.Parse(String s, NumberStyles style, IFormatProvider provider)
at ♥☻tring ☻, NumberFormatInfo ♥)
at ♥♥tring ☻, CultureInfo ♥)
--- End of inner exception stack trace ---
at ♥♥tring ☻, CultureInfo ♥)
at ♥☻tring ☻, CultureInfo ♥)
at ♥☻tring ☻)
--- End of inner exception stack trace ---
at ♥☻tring ☻)
at Aspose.Cells.Drawing.ColorHelper.☻(String ☻)
at ☻▬☻.☻(String ☻)
at ☻▬☻.☻(WorksheetCollection ☻, Font ♥, Hashtable ♣, Hashtable)
at ☻▬☻.☻(Boolean ☻, WorksheetCollection ♥, Font ♣, Char[], ArrayList ♠, Hashtable )
at ☻▬☻.☻(Cell ☻, String ♥, Hashtable ♣)
at Aspose.Cells.Cell.set_HtmlString(String value)
color:inherit
is a valid value and should be supported, or at the very least, not throw an error.
Also tested in latest Aspose Cells (v23.9.0.0)