Skip to content

Commit

Permalink
Fill doesn't working fixed
Browse files Browse the repository at this point in the history
Now it works if set it like this:
sheet1.fill(1, 1, {type:'solid',fgColor:'FF92D050',bgColor:'64'});
  • Loading branch information
aloteot committed Jul 9, 2014
1 parent a763509 commit 08bac71
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/msexcel-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ Style = (function() {
}
}
fills = ss.ele('fills', {
count: this.mfills.length
count: this.mfills.length + 1
});
_ref2 = this.mfills;
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
Expand All @@ -652,15 +652,18 @@ Style = (function() {
});
if (o.fgColor !== '-') {
es.ele('fgColor', {
theme: '8',
tint: '0.79998168889431442'
// theme: '8',
// tint: '0.79998168889431442'
rgb: o.fgColor
});
}
if (o.bgColor !== '-') {
es.ele('bgColor', {
indexed: o.bgColor

This comment has been minimized.

Copy link
@mjesun

mjesun Jan 3, 2016

Would it be possible to use here "rgb" as well? I think this would be much cleaner and understandable 😊

});
}
/*I don't know what it's about, but it's always like this in real excel files*/
if (_j==0) fills.ele('fill').ele('patternFill', { patternType: 'gray125' });
}
bders = ss.ele('borders', {
count: this.mbders.length
Expand Down Expand Up @@ -726,7 +729,8 @@ Style = (function() {
e = cs.ele('xf', {
numFmtId: '0',
fontId: o.font_id - 1,
fillId: o.fill_id - 1,
/*offset caused by one more 'fill' element*/
fillId: o.fill_id - 1 + (o.fill_id - 1 == 0 ? 0 : 1),
borderId: o.bder_id - 1,
xfId: '0'
});
Expand Down

0 comments on commit 08bac71

Please sign in to comment.