Open taylorh140 opened 3 months ago
@taylorh140 Perhaps the following process can be used to obtain the color code.
let book = umya_spreadsheet::reader::xlsx::read(path).unwrap();
let color = book.get_theme().get_theme_elements()
.get_color_scheme()
.get_color_map()
.get(theme_index)
We will fix it so that arbg will always have a numerical value in the next version.
@MathNya This is super helpful. I'll see if I can get it to work on my end but that looks sort of like the direction I was heading.
And yeah argb always having a numerical value would be super nice and very helpful in my case.
Just fyi I have been working on a typst (its similar to a latex) importing plugin for xlsx sheets. so far i can import values and merged cells and i should be able to handle the background colors now.
i think for the first release i would like to get (simple) text alignment and basic borders as well.
but your library is a key technology to make it possible.
Thanks!
@MathNya
I noticed when i used the solution above i get the darkest version of the themed color or the first row color instead of the subsequent ones :
so here i expect : but end up with:
Note that my colors didn't quite turn out right here render wise but they do match the first row (see first image on this post)
@taylorh140 Thank you for your report. Perhaps there is a bug somewhere. We will investigate.
I have been finding that argb colors are sometimes empty when getting the background color:
i have this method to get them so far (extracting to json)
I have to make a copy of the INDEXED_COLORS to extract them at the moment. And im not sure how to decode a themed color.