+ }
+
+ /*
+ * When a pair's content is changed, replace its colors (if pair was
+ * initialized before a screen update is performed replacing original
+ * pair colors with the new ones).
+ */
+ MakeColorPair(result, f, b);
+ if (FORE_OF(previous) != 0
+ && BACK_OF(previous) != 0
+ && !isSamePair(previous, result)) {
+ _nc_change_pair(SP_PARM, pair);
+ }
+
+ _nc_reset_color_pair(SP_PARM, pair, &result);
+ SP_PARM->_color_pairs[pair] = result;
+ _nc_set_color_pair(SP_PARM, pair, cpINIT);
+
+ if (GET_SCREEN_PAIR(SP_PARM) == pair)
+ SET_SCREEN_PAIR(SP_PARM, (int) (~0)); /* force attribute update */
+
+#ifdef USE_TERM_DRIVER
+ CallDriver_3(SP_PARM, td_initpair, pair, f, b);
+#else
+ if (initialize_pair && InPalette(f) && InPalette(b)) {
+ const color_t *tp = DefaultPalette;
+
+ TR(TRACE_ATTRS,
+ ("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)",
+ (int) pair,
+ (int) tp[f].red, (int) tp[f].green, (int) tp[f].blue,
+ (int) tp[b].red, (int) tp[b].green, (int) tp[b].blue));
+
+ NCURSES_PUTP2("initialize_pair",
+ TPARM_7(initialize_pair,
+ pair,
+ (int) tp[f].red,
+ (int) tp[f].green,
+ (int) tp[f].blue,
+ (int) tp[b].red,
+ (int) tp[b].green,
+ (int) tp[b].blue));
+ }
+#endif