aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2020-06-06 11:23:48 +0200
committerMattias EngdegÄrd2020-06-07 10:37:27 +0200
commit9fc935f1225f75eb36091060b02a583cf32ff30c (patch)
treeff19d0500e6f7d4c4a20622b17b87f8ad3ea8e7b
parent788cd6d8b98c0e7750e478ae84e580f29576b5ff (diff)
downloademacs-9fc935f1225f75eb36091060b02a583cf32ff30c.tar.gz
emacs-9fc935f1225f75eb36091060b02a583cf32ff30c.zip
Use 65535 as color-values scale value in the NS backend
* src/nsfns.m (Fxw_color_values): Scale with 65535 instead of 65280, for uniformity with other backends. * lisp/faces.el (color-values): Update doc string. * doc/lispref/frames.texi (Color Names): Update examples.
-rw-r--r--doc/lispref/frames.texi6
-rw-r--r--lisp/faces.el2
-rw-r--r--src/nsfns.m4
3 files changed, 6 insertions, 6 deletions
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 6bf5db2aa1d..966f620558b 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -3975,11 +3975,11 @@ If @var{color} is not defined, the value is @code{nil}.
3975(color-values "black") 3975(color-values "black")
3976 @result{} (0 0 0) 3976 @result{} (0 0 0)
3977(color-values "white") 3977(color-values "white")
3978 @result{} (65280 65280 65280) 3978 @result{} (65535 65535 65535)
3979(color-values "red") 3979(color-values "red")
3980 @result{} (65280 0 0) 3980 @result{} (65535 0 0)
3981(color-values "pink") 3981(color-values "pink")
3982 @result{} (65280 49152 51968) 3982 @result{} (65535 49344 52171)
3983(color-values "hungry") 3983(color-values "hungry")
3984 @result{} nil 3984 @result{} nil
3985@end example 3985@end example
diff --git a/lisp/faces.el b/lisp/faces.el
index e707f6f4b6e..f4a9dedd799 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1822,7 +1822,7 @@ COLOR should be a string naming a color (e.g. \"white\"), or a
1822string specifying a color's RGB components (e.g. \"#ff12ec\"). 1822string specifying a color's RGB components (e.g. \"#ff12ec\").
1823 1823
1824Return a list of three integers, (RED GREEN BLUE), each between 0 1824Return a list of three integers, (RED GREEN BLUE), each between 0
1825and either 65280 or 65535 (the maximum depends on the system). 1825and 65535 inclusive.
1826Use `color-name-to-rgb' if you want RGB floating-point values 1826Use `color-name-to-rgb' if you want RGB floating-point values
1827normalized to 1.0. 1827normalized to 1.0.
1828 1828
diff --git a/src/nsfns.m b/src/nsfns.m
index 273fb5f7598..628233ea0dd 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2329,8 +2329,8 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
2329 [[col colorUsingDefaultColorSpace] 2329 [[col colorUsingDefaultColorSpace]
2330 getRed: &red green: &green blue: &blue alpha: &alpha]; 2330 getRed: &red green: &green blue: &blue alpha: &alpha];
2331 unblock_input (); 2331 unblock_input ();
2332 return list3i (lrint (red * 65280), lrint (green * 65280), 2332 return list3i (lrint (red * 65535), lrint (green * 65535),
2333 lrint (blue * 65280)); 2333 lrint (blue * 65535));
2334} 2334}
2335 2335
2336 2336