changeset 10717:e0f6b4ab7412

(x_decode_color): Ignore failure from defined_color.
author Richard M. Stallman <rms@gnu.org>
date Sun, 12 Feb 1995 01:25:14 +0000
parents 7418dce6e52a
children b4bfe218c4ca
files src/xfns.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Sun Feb 12 01:22:28 1995 +0000
+++ b/src/xfns.c	Sun Feb 12 01:25:14 1995 +0000
@@ -1016,10 +1016,11 @@
   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'