diff options
| author | Mark Oteiza | 2017-09-15 13:27:39 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2017-09-15 13:30:20 -0400 |
| commit | 6e38b9253e3d67def0e16f90da574b4622d962a3 (patch) | |
| tree | 03c88e81c08aed30f2bf242d683098b82077f5b5 /src | |
| parent | 7911ebc6101679fed116218e8b5c08f11c712f51 (diff) | |
| download | emacs-6e38b9253e3d67def0e16f90da574b4622d962a3.tar.gz emacs-6e38b9253e3d67def0e16f90da574b4622d962a3.zip | |
Fix color-distance docstring
Also feed the translated color to the metric argument.
* src/xfaces.c (color-distance): Reword docstring to be more helpful.
Avoid duplicating effort in lcms2 by passing the translated 16 bit RGB
instead of the function's color arguments.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfaces.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 012de4e7af1..b309c161278 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -4093,7 +4093,8 @@ DEFUN ("color-distance", Fcolor_distance, Scolor_distance, 2, 4, 0, | |||
| 4093 | COLOR1 and COLOR2 may be either strings containing the color name, | 4093 | COLOR1 and COLOR2 may be either strings containing the color name, |
| 4094 | or lists of the form (RED GREEN BLUE), each in the range 0 to 65535 inclusive. | 4094 | or lists of the form (RED GREEN BLUE), each in the range 0 to 65535 inclusive. |
| 4095 | If FRAME is unspecified or nil, the current frame is used. | 4095 | If FRAME is unspecified or nil, the current frame is used. |
| 4096 | If METRIC is unspecified or nil, a modified L*u*v* metric is used. */) | 4096 | If METRIC is specified, it should be a function that accepts |
| 4097 | two lists of the form (RED GREEN BLUE) aforementioned. */) | ||
| 4097 | (Lisp_Object color1, Lisp_Object color2, Lisp_Object frame, | 4098 | (Lisp_Object color1, Lisp_Object color2, Lisp_Object frame, |
| 4098 | Lisp_Object metric) | 4099 | Lisp_Object metric) |
| 4099 | { | 4100 | { |
| @@ -4112,7 +4113,13 @@ If METRIC is unspecified or nil, a modified L*u*v* metric is used. */) | |||
| 4112 | if (NILP (metric)) | 4113 | if (NILP (metric)) |
| 4113 | return make_number (color_distance (&cdef1, &cdef2)); | 4114 | return make_number (color_distance (&cdef1, &cdef2)); |
| 4114 | else | 4115 | else |
| 4115 | return call2 (metric, color1, color2); | 4116 | return call2 (metric, |
| 4117 | list3 (make_number (cdef1.red), | ||
| 4118 | make_number (cdef1.green), | ||
| 4119 | make_number (cdef1.blue)), | ||
| 4120 | list3 (make_number (cdef2.red), | ||
| 4121 | make_number (cdef2.green), | ||
| 4122 | make_number (cdef2.blue))); | ||
| 4116 | } | 4123 | } |
| 4117 | 4124 | ||
| 4118 | 4125 | ||