Mercurial > emacs
comparison src/xfns.c @ 8655:4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 28 Aug 1994 20:00:21 +0000 |
parents | 8b5d6aba9b46 |
children | 1fe413b0a916 |
comparison
equal
deleted
inserted
replaced
8654:0334c1b51e87 | 8655:4c69fcaaa037 |
---|---|
2942 return list; | 2942 return list; |
2943 } | 2943 } |
2944 | 2944 |
2945 | 2945 |
2946 DEFUN ("x-color-defined-p", Fx_color_defined_p, Sx_color_defined_p, 1, 1, 0, | 2946 DEFUN ("x-color-defined-p", Fx_color_defined_p, Sx_color_defined_p, 1, 1, 0, |
2947 "Return t if the current X display supports the color named COLOR.") | 2947 "Return non-nil if the X display supports the color named COLOR.\n\ |
2948 The value is actually a list of integer RGB values--(RED GREEN BLUE).") | |
2948 (color) | 2949 (color) |
2949 Lisp_Object color; | 2950 Lisp_Object color; |
2950 { | 2951 { |
2951 Color foo; | 2952 Color foo; |
2952 | 2953 |
2953 check_x (); | 2954 check_x (); |
2954 CHECK_STRING (color, 0); | 2955 CHECK_STRING (color, 0); |
2955 | 2956 |
2956 if (defined_color (XSTRING (color)->data, &foo)) | 2957 if (defined_color (XSTRING (color)->data, &foo)) |
2957 return Qt; | 2958 { |
2959 Lisp_Object rgb[3]; | |
2960 | |
2961 rgb[0] = make_number (foo.red); | |
2962 rgb[1] = make_number (foo.green); | |
2963 rgb[2] = make_number (foo.blue); | |
2964 return Flist (3, rgb); | |
2965 } | |
2958 else | 2966 else |
2959 return Qnil; | 2967 return Qnil; |
2960 } | 2968 } |
2961 | 2969 |
2962 DEFUN ("x-display-color-p", Fx_display_color_p, Sx_display_color_p, 0, 0, 0, | 2970 DEFUN ("x-display-color-p", Fx_display_color_p, Sx_display_color_p, 0, 0, 0, |