From 053b3256838699849db10972e2146f57fc10fd55 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Sun, 28 Oct 2001 20:57:00 +0000 Subject: [PATCH] (x_build_heuristic_mask): Use x_alloc_image_color. --- src/ChangeLog | 2 ++ src/xfns.c | 12 ++---------- 2 files changed, 4 insertions(+), 10 deletions(-) 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; } } -- 2.39.5