From 58387771b5b9124d0ef9e76f7efcb7594e656305 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Feb 1995 01:25:14 +0000 Subject: [PATCH] (x_decode_color): Ignore failure from defined_color. --- src/xfns.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/xfns.c b/src/xfns.c index 37e418ecadd..993194283f7 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1016,10 +1016,11 @@ x_decode_color (f, arg, def) if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1) return def; - if (defined_color (f, XSTRING (arg)->data, &cdef, 1)) - return cdef.pixel; - else - Fsignal (Qundefined_color, Fcons (arg, Qnil)); + /* Ignore the return value of defined_color so that + we use a color close to the one requested + if we can't get the exact request. */ + defined_color (f, XSTRING (arg)->data, &cdef, 1); + return cdef.pixel; } /* Functions called only from `x_set_frame_param' -- 2.39.5