- target = state->common->colcount[i*3+which];
- count = count_rowcol(state, i, COLUMN, which);
- c = 0;
- if ((count > target) ||
- (count < target && !count_rowcol(state, i, COLUMN, -1)))
- c |= DS_ERROR;
- if (count == target) c |= DS_FULL;
- if (c != ds->colwhat[i*3+which] || !ds->started) {
- draw_num(dr, ds, COLUMN, which, i, c,
- state->common->colcount[i*3+which]);
- ds->colwhat[i*3+which] = c;
+ int index = i * 3 + which;
+ int target = state->common->colcount[index];
+ int color = get_count_color(state, COLUMN, which, i, target);
+
+ if (color != ds->colwhat[index] || !ds->started) {
+ draw_num(dr, ds, COLUMN, which, i, COL_BACKGROUND, color, target);
+ ds->colwhat[index] = color;