Description
When importing an Excel file that contains 6-character color codes (e.g. 3366CC) in its cell styles, the import fails with the following JavaScript error:
TypeError: Cannot read properties of null (reading '2')
at toCSSColor (index-esm.js)
at getColor (index-esm.js)
Files that use 8-character color codes (e.g. FF3366CC) or only named/indexed colors load correctly. The issue can be triggered by any tool or library that generates XLSX files with 6-character color values - Apache POI is one known example.
Steps To Reproduce
spreadsheet-6char-color.xlsx.zip
- Download the attached Excel file that was pre-built to contain a 6-character color value.
- Try to import it in the Spreadsheet in the following demo - https://demos.telerik.com/kendo-angular-ui/demos/spreadsheet/tools/menu?theme=meridian-main
- Open the browser console to observe the error.
Screenshots or video
Actual Behavior
The import throws an unhandled error and cannot render the Excel file.
Expected Behavior
The file should load and the Spreadsheet should display the content. Custom colors should render correctly, or fall back to a default if unsupported.
Description
When importing an Excel file that contains 6-character color codes (e.g.
3366CC) in its cell styles, the import fails with the following JavaScript error:Files that use 8-character color codes (e.g.
FF3366CC) or only named/indexed colors load correctly. The issue can be triggered by any tool or library that generates XLSX files with 6-character color values - Apache POI is one known example.Steps To Reproduce
spreadsheet-6char-color.xlsx.zip
Screenshots or video
Actual Behavior
The import throws an unhandled error and cannot render the Excel file.
Expected Behavior
The file should load and the Spreadsheet should display the content. Custom colors should render correctly, or fall back to a default if unsupported.