aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2009-08-20 09:44:06 +0000
committerYAMAMOTO Mitsuharu2009-08-20 09:44:06 +0000
commitfb67c21b69ec4f4f34d5d6d1627bc1eaef208c8f (patch)
treea30cc47a120ff72fe510fcd8a14541d44bdbe565
parentfb89fad99d75c3ff3ca695864abf4446ab4487e7 (diff)
downloademacs-fb67c21b69ec4f4f34d5d6d1627bc1eaef208c8f.tar.gz
emacs-fb67c21b69ec4f4f34d5d6d1627bc1eaef208c8f.zip
(Fxw_color_values): Return 3-element list. Doc fix.
-rw-r--r--src/nsfns.m15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/nsfns.m b/src/nsfns.m
index 9414f47d833..136ae0310c1 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2232,16 +2232,12 @@ The optional argument FRAME is currently ignored. */)
2232 2232
2233 2233
2234DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, 2234DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
2235 doc: /* Return a description of the color named COLOR. 2235 doc: /* Internal function called by `color-values', which see. */)
2236The value is a list of integer RGBA values--(RED GREEN BLUE ALPHA).
2237These values appear to range from 0 to 65280; white is (65280 65280 65280 0).
2238The optional argument FRAME is currently ignored. */)
2239 (color, frame) 2236 (color, frame)
2240 Lisp_Object color, frame; 2237 Lisp_Object color, frame;
2241{ 2238{
2242 NSColor * col; 2239 NSColor * col;
2243 float red, green, blue, alpha; 2240 float red, green, blue, alpha;
2244 Lisp_Object rgba[4];
2245 2241
2246 check_ns (); 2242 check_ns ();
2247 CHECK_STRING (color); 2243 CHECK_STRING (color);
@@ -2251,12 +2247,9 @@ The optional argument FRAME is currently ignored. */)
2251 2247
2252 [[col colorUsingColorSpaceName: NSCalibratedRGBColorSpace] 2248 [[col colorUsingColorSpaceName: NSCalibratedRGBColorSpace]
2253 getRed: &red green: &green blue: &blue alpha: &alpha]; 2249 getRed: &red green: &green blue: &blue alpha: &alpha];
2254 rgba[0] = make_number (lrint (red*65280)); 2250 return list3 (make_number (lrint (red*65280)),
2255 rgba[1] = make_number (lrint (green*65280)); 2251 make_number (lrint (green*65280)),
2256 rgba[2] = make_number (lrint (blue*65280)); 2252 make_number (lrint (blue*65280)));
2257 rgba[3] = make_number (lrint (alpha*65280));
2258
2259 return Flist (4, rgba);
2260} 2253}
2261 2254
2262 2255