You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.
Each Microsoft Excel workbook has a palette of 56 colors that you can apply to cells, fonts, gridlines, graphic objects, and fills and lines in a chart.
Sorry for asking this here (I don't know if this is the proper place to ask questions), but there's no way to set a custom RGB color into an XSSFColor object? We are restricted to the 56 colors of default Excel palette?
This seems to be more of a limitation of the library. You are able to set custom colors within excel why are you not able to do it with this library. Maybe this should be reopened and tagged as a feature request?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
With the following code, the 1st way of creating a color works but the two commented out ones do not. Am I doing something wrong?
IWorkbook workbook = new XSSFWorkbook();
var UniversalStyle = workbook.CreateCellStyle();
UniversalStyle.FillForegroundColor = HSSFColor.Automatic.Index;
UniversalStyle.FillPattern = FillPattern.NoFill;
UniversalFont = workbook.CreateFont();
UniversalFont.Color = HSSFColor.Blue.Index;
// UniversalFont.Color = new XSSFColor(new byte[3] { 65, 124, 153 }).Indexed;
// UniversalFont.Color = new XSSFColor(System.DrawingCore.Color.FromArgb(65, 124, 153)).Indexed;
UniversalStyle.SetFont(UniversalFont);
IRow row = sheet1.CreateRow(RowIndex++);
ICell test = row.CreateCell(ColIndex++);
test.CellStyle = UniversalStyle;
test.SetCellType(CellType.String);
test.SetCellValue("This should be Blue-ish");
The text was updated successfully, but these errors were encountered: