fix colors
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 8 Dec 2025 18:01:58 +0000 (10:01 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 8 Dec 2025 18:01:58 +0000 (10:01 -0800)
rust/pspp/src/output/pivot/look_xml.rs
rust/pspp/src/output/spv/light.rs

index fcefe65c355e5e12e05b3918237d881037271f5c..85bc1186a3c66793c3966179fced1af0ffe9f8b8 100644 (file)
@@ -236,8 +236,8 @@ impl CellStyle {
                     RowParity::Odd => self.alternating_text_color.unwrap_or(Color::BLACK),
                 },
                 bg: match data_row {
-                    RowParity::Even => self.color2.unwrap_or(Color::BLACK),
-                    RowParity::Odd => self.alternating_color.unwrap_or(Color::BLACK),
+                    RowParity::Even => self.color2.unwrap_or(Color::WHITE),
+                    RowParity::Odd => self.alternating_color.unwrap_or(Color::WHITE),
                 },
                 size: self.font_size.as_pt_i32(),
             },
index 7b120d5448ba99ebcf30fde90be158cc0189cdc6..263f751004891acc36d2b0dcce0a732587894673 100644 (file)
@@ -431,13 +431,15 @@ impl Area {
                 italic: (self.style & 2) != 0,
                 underline: self.underline,
                 font: self.typeface.decode(encoding),
-                fg: match data_row {
-                    RowParity::Even => self.fg,
-                    RowParity::Odd => self.alt_fg,
+                fg: if data_row == RowParity::Odd && self.alternate {
+                    self.alt_fg
+                } else {
+                    self.fg
                 },
-                bg: match data_row {
-                    RowParity::Even => self.bg,
-                    RowParity::Odd => self.alt_bg,
+                bg: if data_row == RowParity::Odd && self.alternate {
+                    self.alt_bg
+                } else {
+                    self.bg
                 },
                 size: (self.size / 1.33) as i32,
             },