+#if USE_EXTENDED_COLOR
+static int
+InitColor(int pair, int r, int g, int b)
+{
+ int rc;
+ if (x_opt) {
+ rc = init_extended_color(pair, r, g, b);
+ } else {
+ rc = init_color((NCURSES_PAIRS_T) pair,
+ (NCURSES_COLOR_T) r,
+ (NCURSES_COLOR_T) g,
+ (NCURSES_COLOR_T) b);
+ }
+ return rc;
+}
+
+static int
+ColorContent(int color, int *rp, int *gp, int *bp)
+{
+ int rc;
+ if (x_opt) {
+ rc = extended_color_content(color, rp, gp, bp);
+ } else {
+ NCURSES_COLOR_T r, g, b;
+ if ((rc = color_content((NCURSES_COLOR_T) color, &r, &g, &b)) == OK) {
+ *rp = r;
+ *gp = g;
+ *bp = b;
+ }
+ }
+ return rc;
+}
+#else
+#define InitColor(color,r,g,b) init_color((NCURSES_COLOR_T)color,(NCURSES_COLOR_T)r,(NCURSES_COLOR_T)g,(NCURSES_COLOR_T)b)
+#define ColorContent(color,rp,gp,bp) color_content((NCURSES_COLOR_T)color,rp,gp,bp)
+#endif
+
+static my_color_t