From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.devel Subject: Re: Doc string and operation of color-distance Date: Thu, 14 Sep 2017 15:12:26 -0400 Message-ID: <20170914191226.GA30876@holos.localdomain> References: <83mv5xm84m.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1505416359 4185 195.159.176.226 (14 Sep 2017 19:12:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 14 Sep 2017 19:12:39 +0000 (UTC) User-Agent: Mutt/1.9.0 (2017-09-02) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 14 21:12:35 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsZYw-0000wf-Sh for ged-emacs-devel@m.gmane.org; Thu, 14 Sep 2017 21:12:35 +0200 Original-Received: from localhost ([::1]:49599 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsZZ4-0004tE-BG for ged-emacs-devel@m.gmane.org; Thu, 14 Sep 2017 15:12:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsZYx-0004t0-Gp for emacs-devel@gnu.org; Thu, 14 Sep 2017 15:12:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsZYs-0000xW-Ht for emacs-devel@gnu.org; Thu, 14 Sep 2017 15:12:35 -0400 Original-Received: from mail-qt0-x22c.google.com ([2607:f8b0:400d:c0d::22c]:49832) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dsZYs-0000un-AB for emacs-devel@gnu.org; Thu, 14 Sep 2017 15:12:30 -0400 Original-Received: by mail-qt0-x22c.google.com with SMTP id f24so305068qte.6 for ; Thu, 14 Sep 2017 12:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=F+9mp96cltSj/wGfQKZhTvJOCJRdDZB8ieBi/DB9Ds4=; b=VT7YuuUWcN3vjYOIoXfBP+QWSeoVkkKo913J904c1AjCsJKuETvYRzdgjP9Kfqfpph BSOppEpkrAIMzPfqdJEaU5vakabdGs9IvIDars2799kPwJv0iodSq6cqfytT9c2ERBha +4qNLpYIFUOcSsln6h0MCqjrAfF5lQPEzcaxUNEHCrNDdvyqo6/Te+JpB8bb4RMq9tJk QWSwlDGCaYQA7Gh7cOmzJdfwgO9wjVrGo88MWL8aleHh+YGy69I6D2mi+UagE8wEM2/d xPdb4edojeg9sSgmzB6bZve0roB0SRP0GIZRQS4TYu1uEU7LX+nY5+rntdLxEDtQL79f MVUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=F+9mp96cltSj/wGfQKZhTvJOCJRdDZB8ieBi/DB9Ds4=; b=m1W1LxbHG4kFrplzbwFPswofkLuFNqmNgaitvGKk1O9cBaSu7hIhyI5gFjuu/appwC t60G2M69JiKZSfuBdpSt2jOcQkHv6NhPeUp+Tv2O5XfEyc5sPObxvnkDdniDSCCMoPT6 +mk6CNvUzXUNKAyQ7PnEOOfo95FEw4evVOxJJWmGA3vbQVuG7CUd5jifPD9vf+9tAQ/w 6zVWPUUgFiaWa8TRzRCPHFkBZzPQzNyoNJrNTiAPhVDmSc9FUM/V+qRjlyK9CNoArl/t DjXKuGf+VTyqH4hrnlkawsme1cJS0dUldVH13WWmugqbB8sOJ0nR9Hh0CD4OhOehlQhu WxxA== X-Gm-Message-State: AHPjjUicgoWneTzFAJhn1mORBtObCM/QzueS3x+IjLpjU0Hd+IiuLzs5 7ijNRR1jy3Zxq4Jco/3ozA== X-Google-Smtp-Source: AOwi7QCx6Rkcd0kBs4U+EgtJrRQ0nwESe6mKsAGOXL2D6Q3w9gdIPdQNwDEFkuo1Yu/5LgOlsoZtgg== X-Received: by 10.200.55.47 with SMTP id o44mr29403246qtb.240.1505416348385; Thu, 14 Sep 2017 12:12:28 -0700 (PDT) Original-Received: from holos.localdomain (pool-173-67-36-61.bltmmd.fios.verizon.net. [173.67.36.61]) by smtp.gmail.com with ESMTPSA id s66sm3248568qkc.8.2017.09.14.12.12.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Sep 2017 12:12:27 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id 80AC269FAF; Thu, 14 Sep 2017 15:12:26 -0400 (EDT) Content-Disposition: inline In-Reply-To: <83mv5xm84m.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218287 Archived-At: 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.