Solid fill become black
StephanMeijer opened this issue ยท 6 comments
When using solid fill, the cell seems to become black entirely. It might be the case because I am using LibreOffice. Google Spreadsheets does not color the cell at all.
I recently had cause to use a solid fill myself, and no problem on it (sets an off-red background) -
cell.fill = {
type: "pattern",
pattern: "solid",
fgColor: {
argb: "FFFF7D7D"
},
bgColor: {
argb: "FF000000"
}
}
Could you have done it slightly differently? (As a side note, Excel can really mess up with fills on empty cells at the end of rows - it's ugly).
@StephanMeijer I've just published 0.4.2, which I'm hoping will resolve this issue. I've fixed an issue with handling themes which can cause the effects you're seeing.
Could you check whether this has fixed your problem?
@guyonroche I have the same issue even after updating to 0.4.2 also I am using Excel 2016 to read the output xlsx
@StephanMeijer @guyonroche I found that after setting both fgColor and bgColor to the same value I get my intended fill color with black text.
currentSheet.getRow(2).getCell(2).value = 'Test Text'; currentSheet.getRow(2).getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFFFFF00'}, bgColor:{argb:'FFFFFF00'} };
Will yield a yellow background with black text of "Test Text"
fgColor is the color of your filling. you only need to specify fgColor if you're using solid
this is how you fill with red color:
{
type: 'pattern',
pattern: 'solid',
fgColor: { argb:'FFFF0000' }
};