- if (!Ok()) return;
-
- if ((M_COLDATA->m_hasPixel) && (M_COLDATA->m_colormap == cmap)) return;
- M_COLDATA->FreeColour();
-
-#ifdef wxUSE_GDK_IMLIB
-
- int r = M_COLDATA->m_color.red >> SHIFT;
- int g = M_COLDATA->m_color.green >> SHIFT;
- int b = M_COLDATA->m_color.blue >> SHIFT;
- M_COLDATA->m_hasPixel = TRUE;
- M_COLDATA->m_color.pixel = gdk_imlib_best_color_match( &r, &g, &b );
-
-#else
-
- M_COLDATA->m_hasPixel = gdk_color_alloc( cmap, &M_COLDATA->m_color );
-
-#endif
-
- M_COLDATA->m_colormap = cmap;