[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Doc string and operation of color-distance
From: |
Mark Oteiza |
Subject: |
Re: Doc string and operation of color-distance |
Date: |
Thu, 14 Sep 2017 15:12:26 -0400 |
User-agent: |
Mutt/1.9.0 (2017-09-02) |
On 14/09/17 at 09:45pm, Eli Zaretskii wrote:
> Mark, the new color-distance says something strange in its doc string:
>
> (color-distance COLOR1 COLOR2 &optional FRAME METRIC)
>
> Return an integer distance between COLOR1 and COLOR2 on FRAME.
> COLOR1 and COLOR2 may be either strings containing the color name,
> or lists of the form (RED GREEN BLUE), each in the range 0 to 65535
> inclusive.
> If FRAME is unspecified or nil, the current frame is used.
> If METRIC is unspecified or nil, a modified L*u*v* metric is used.
>
> The last sentence should say "non-nil", I think
No, the 'nil' is correct--if no metric is given as an argument,
color_distance is used which, as the comments say, is a modified L*u*v*
metric.
> and it should
> document that METRIC is supposed to be a function of 2 colors.
True, that would be helpful.
> Also, this is unexpected:
>
> (color-distance "red" "blue" nil 'lcms-cam02-ucs)
> => (error "Invalid color" "red")
>
> I think the new lcms2 functions should support colors specified as
> strings, because all the other color-related functions do.
I thought (but did not test) the body of color-distance did the lookups.
Now I see what's going on.