SpreadJS Documentation
foreColor Field
Indicates the foreground color.
Syntax
var instance = new GcSpread.Sheets.Style(backColor,
                                        foreColor,
                                        hAlign,
                                        vAlign,
                                        font,
                                        themeFont,
                                        formatter,
                                        borderLeft,
                                        borderTop,
                                        borderRight,
                                        borderBottom,
                                        locked,
                                        textIndent,
                                        wordWrap,
                                        shrinkToFit,
                                        backgroundImage,
                                        cellType,
                                        backgroundImageLayout,
                                        tabStop,
                                        textDecoration,
                                        imeMode,
                                        name,
                                        parentName,
                                        watermark);
var value; // Type: string
value = instance.foreColor;
var foreColor : string;
Example
This example sets the foreColor property.
activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]);
var cell = new GcSpread.Sheets.CellValueRule();
cell.operator = 2;
cell.value1 = 5;
cell.ranges = [new GcSpread.Sheets.Range(0, 0, 10, 1)];
cell.style = new GcSpread.Sheets.Style();
cell.style.backColor = "red";
cell.style.foreColor = "black";
activeSheet.getConditionalFormats().addRule(cell);

var top = new GcSpread.Sheets.Top10Rule();
top.type = 0;
top.rank = 3;
top.stopIfTrue(true);
top.ranges = [new GcSpread.Sheets.Range(0, 0, 10, 1)];
top.style = new GcSpread.Sheets.Style();
top.style.foreColor = "red";
activeSheet.getConditionalFormats().addRule(top);
See Also

Reference

Style class

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.