3939import docking .widgets .table .TableSortState ;
4040import docking .widgets .table .TableSortStateEditor ;
4141import docking .widgets .table .ColumnSortState .SortDirection ;
42+ import generic .theme .GColor ;
4243import ghidra .util .Msg ;
4344import ghidra .util .exception .CancelledException ;
4445import ghidra .util .task .Task ;
@@ -125,6 +126,19 @@ public Component getTableCellRendererComponent(GTableCellRenderingData data) {
125126 return component ;
126127 }
127128 });
129+
130+ final var colors = new GColor [] {
131+ new GColor ("color.lightkeeper.coverage_lt_20.bg" ),
132+ new GColor ("color.lightkeeper.coverage_lt_20.fg" ),
133+ new GColor ("color.lightkeeper.coverage_lt_40.bg" ),
134+ new GColor ("color.lightkeeper.coverage_lt_40.fg" ),
135+ new GColor ("color.lightkeeper.coverage_lt_60.bg" ),
136+ new GColor ("color.lightkeeper.coverage_lt_60.fg" ),
137+ new GColor ("color.lightkeeper.coverage_lt_80.bg" ),
138+ new GColor ("color.lightkeeper.coverage_lt_80.fg" ),
139+ new GColor ("color.lightkeeper.coverage_default.bg" ),
140+ new GColor ("color.lightkeeper.coverage_default.fg" )
141+ };
128142 tableView .getColumnModel ().getColumn (0 ).setCellRenderer (new GTableCellRenderer () {
129143 @ Override
130144 public Component getTableCellRendererComponent (GTableCellRenderingData data ) {
@@ -149,20 +163,20 @@ public Component getTableCellRendererComponent(GTableCellRenderingData data) {
149163
150164 private void setPercentageBackgroundColor (Component component , double coverage ) {
151165 if (coverage < 0.20d ) {
152- component .setBackground (Color . BLUE );
153- component .setForeground (Color . WHITE );
166+ component .setBackground (colors [ 0 ] );
167+ component .setForeground (colors [ 1 ] );
154168 } else if (coverage < 0.40d ) {
155- component .setBackground (Color . GREEN );
156- component .setForeground (Color . BLACK );
169+ component .setBackground (colors [ 2 ] );
170+ component .setForeground (colors [ 3 ] );
157171 } else if (coverage < 0.60d ) {
158- component .setBackground (Color . YELLOW );
159- component .setForeground (Color . BLACK );
172+ component .setBackground (colors [ 4 ] );
173+ component .setForeground (colors [ 5 ] );
160174 } else if (coverage < 0.80d ) {
161- component .setBackground (Color . ORANGE );
162- component .setForeground (Color . BLACK );
175+ component .setBackground (colors [ 6 ] );
176+ component .setForeground (colors [ 7 ] );
163177 } else {
164- component .setBackground (Color . RED );
165- component .setForeground (Color . WHITE );
178+ component .setBackground (colors [ 8 ] );
179+ component .setForeground (colors [ 9 ] );
166180 }
167181 }
168182 });
0 commit comments