colorRgb property
Gets/sets borderline color Rgb.
Implementation
@override
Color get colorRgb {
Color colorStyle = _colorRgb;
bool first = true;
for (final Border? border in _borders) {
if (first) {
colorStyle = border!.colorRgb;
first = false;
} else if (border!.colorRgb != colorStyle) {
return const Color.fromARGB(255, 0, 0, 0);
}
}
return colorStyle;
}
Gets/sets borderline color Rgb.
final Workbook workbook = Workbook();
final Worksheet sheet = workbook.worksheets[0];
final Style style = workbook.styles.add('style');
// set borders line color.
style.borders.all.lineStyle = LineStyle.thick;
style.borders.all.colorRgb = Color.fromARBG(255, 255, 56, 255);
final Range range1 = sheet.getRangeByIndex(3, 4);
range1.number = 10;
range1.cellStyle = style;
final List<int> bytes = workbook.saveAsStream();
File('CellStyle.xlsx').writeAsBytes(bytes);
workbook.dispose();
Implementation
@override
set colorRgb(Color value) {
for (final Border? border in _borders) {
border!.colorRgb = value;
}
}