row style

This commit is contained in:
2025-12-28 19:02:00 +03:00
parent b13d113be6
commit 0be8937fea
6 changed files with 50 additions and 9 deletions

View File

@@ -181,10 +181,19 @@ func DrawTableWarm(header []string, rows []any) image.Image {
y := headerHeight
for rowIndex, row := range rows {
bg := rowBg1
if rowIndex%2 == 1 {
bg = rowBg2
}
sCells := row
switch rt := row.(type) {
case ITableRow:
bg = rt.GetBackgroundColor()
sCells = rt.GetCells()
}
// фон строки
for xx := 0; xx < imgWidth; xx++ {
for yy := 0; yy < rowHeight; yy++ {
@@ -197,7 +206,7 @@ func DrawTableWarm(header []string, rows []any) image.Image {
img.Set(xx, y, dividerCol)
}
cells := rowToStrings(row)
cells := rowToStrings(sCells)
x = 0
for i := 0; i < colCount && i < len(cells); i++ {