Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solid fill become black #272

Closed
StephanMeijer opened this issue Feb 23, 2017 · 6 comments
Closed

Solid fill become black #272

StephanMeijer opened this issue Feb 23, 2017 · 6 comments
Labels

Comments

@StephanMeijer
Copy link

StephanMeijer commented Feb 23, 2017

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.

@Rycochet
Copy link
Contributor

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).

@guyonroche
Copy link
Collaborator

@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?

@IT-MikeS
Copy link

IT-MikeS commented Mar 23, 2017

@guyonroche I have the same issue even after updating to 0.4.2 also I am using Excel 2016 to read the output xlsx

@IT-MikeS
Copy link

IT-MikeS commented Mar 23, 2017

@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"

@grumd
Copy link

grumd commented May 31, 2017

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' }
};

fpaupier added a commit to fpaupier/exceljs that referenced this issue Mar 30, 2021
Current doc for cell filling could lead to misunderstanding on how to apply a simple fill color
to a cell.

Related to exceljs#272
@fpaupier
Copy link
Contributor

I think this issue is legit as I stumbled on the proper usage of cell filling today again. I opened a PR to clarify the doc about it.
#1649

Siemienik pushed a commit that referenced this issue Apr 11, 2021
Current doc for cell filling could lead to misunderstanding on how to apply a simple fill color
to a cell.

Related to #272
@exceljs exceljs locked and limited conversation to collaborators Apr 11, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

7 participants