From: Gerd Moellmann Date: Sun, 28 Oct 2001 20:57:00 +0000 (+0000) Subject: (x_build_heuristic_mask): Use x_alloc_image_color. X-Git-Tag: ttn-vms-21-2-B4~19065 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=053b3256838699849db10972e2146f57fc10fd55;p=emacs.git (x_build_heuristic_mask): Use x_alloc_image_color. --- diff --git a/src/ChangeLog b/src/ChangeLog index ef7fdb24170..f7273b44cfb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5,6 +5,8 @@ 2001-10-28 Gerd Moellmann + * xfns.c (x_build_heuristic_mask): Use x_alloc_image_color. + * xfns.c (x_build_heuristic_mask): Fix a bug not incrementing a loop counter. diff --git a/src/xfns.c b/src/xfns.c index fb71e47c14c..96ddd1f4dc8 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -8196,17 +8196,9 @@ x_build_heuristic_mask (f, img, how) if (i == 3 && NILP (how)) { char color_name[30]; - XColor exact, color; - Colormap cmap; - sprintf (color_name, "#%04x%04x%04x", rgb[0], rgb[1], rgb[2]); - - cmap = FRAME_X_COLORMAP (f); - if (XLookupColor (dpy, cmap, color_name, &exact, &color)) - { - bg = color.pixel; - use_img_background = 0; - } + bg = x_alloc_image_color (f, img, build_string (color_name), 0); + use_img_background = 0; } }