qrilka / xlsx

Simple and incomplete Excel file parser/writer
MIT License
128 stars 62 forks source link

Request: Minimal working example for styles #166

Closed deemp closed 1 year ago

deemp commented 1 year ago

Hello! I'm trying to apply styles to my worksheet. I made an example, but I can't set a color for a cell.

https://gist.github.com/deemp/4d3fafd3885e9846814bf87287466d5f

Could you please provide a minimal working example with colors?

qrilka commented 1 year ago

Please take a look at this thing - https://gist.github.com/qrilka/ffd9fe984e3a50fa1b0bb6c5bcd7859c xlsx is sometimes a bit odd, for example - take a look at the definition of minimalStyleSheet, you need to have some defaults in your stylesheet, and the main thing is using foreground color for a pattern not a background one.

deemp commented 1 year ago

@qrilka, thank you so much! When running your example, I got (3, 2) painted grey. This behavior should be related to this issue.

qrilka commented 1 year ago

PR will be more than welcome if you could find out the details behind this behavior