Theme XLColor to System.Drawing.Color
See original GitHub issueIs there a way to convert a cell’s fill background color if it is a theme ColorType to system.drawing.color ?
XLColor c = XLColor.FromTheme(cell.Style.Fill.BackgroundColor.ThemeColor, cell.Style.Fill.BackgroundColor.ThemeTint);
return c.Color;
fails :
"Cannot convert theme color to Color."
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to convert System.Drawing.Color to ClosedXML.Excel ...
My question is: Is there appropriate method to convert System.Drawing.Color to ClosedXML.Excel.XLColor? Any comments or suggestions are welcome.
Read more >Color.FromArgb Method (System.Drawing)
Creates a Color structure from the four ARGB component (alpha, red, green, and blue) values. Although this method allows a 32-bit value to...
Read more >ColorTranslator.FromHtml(String) Method (System.Drawing)
This method translates a string representation of an HTML color name, such as Blue or Red, to a GDI+ Color structure. Applies to....
Read more >How to convert System.Drawing.Color to ClosedXML.Excel ...
I've never used ClosedXml but the fine manual shows many ways an XLColor can be created. I picked on the first when writing...
Read more >【.NET 5】【WPF】【ClosedXML】Draw and print spreadsheets 1
Fonts and Borders have two color types. When their color types are "Color", I can get color from "XLColor.Color". But if they are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Look at #210 :
A method in ClosedXml would be nice to have. The color won’t be correct until it has the theme color tint applied to it.
Something like this is close to the System.Color returned from Excel Interop for a themed cell.