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: Fri, 15 Sep 2017 11:15:59 -0400 Message-ID: <20170915151559.GA14552@holos.localdomain> References: <83mv5xm84m.fsf@gnu.org> <874ls5xdzz.fsf@udel.edu> <831sn8m66n.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1505488575 24699 195.159.176.226 (15 Sep 2017 15:16:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 15 Sep 2017 15:16:15 +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 Fri Sep 15 17:16:09 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 1dssLh-0006AP-3A for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2017 17:16:09 +0200 Original-Received: from localhost ([::1]:53777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dssLl-0003Yf-Gg for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2017 11:16:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dssLe-0003YT-B1 for emacs-devel@gnu.org; Fri, 15 Sep 2017 11:16:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dssLa-0002KN-4P for emacs-devel@gnu.org; Fri, 15 Sep 2017 11:16:06 -0400 Original-Received: from mail-qt0-x22f.google.com ([2607:f8b0:400d:c0d::22f]:52747) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dssLZ-0002JL-Ux for emacs-devel@gnu.org; Fri, 15 Sep 2017 11:16:02 -0400 Original-Received: by mail-qt0-x22f.google.com with SMTP id o52so2429208qtc.9 for ; Fri, 15 Sep 2017 08:16:01 -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:content-transfer-encoding:in-reply-to :user-agent; bh=+xW6ayc9M1wqdT6APwQxZ4pHhnuhNab/rKvwVWqJfao=; b=ONPbw2qTFTYsgFhgqi2HOuy7mqkI16pMkpOvHwjCrrHHouBZ/q7CHp+t2iyky4xRh0 APoyDSPUa4zFbNB0bBDTyX4qTSJ6WiPmb+mjiHAIgBcDQ23GP2RdoRwSo9uJB4wQh+Lh PsQY5SdfNHQEskQK1oKwQMgXevuVi7k1uVCwOJeS8ORU8zVTQsVrBUUbNP9x6W6IFQC3 QGsGktE1bVD87RHjaO2RQrlv7UJKGLvwLuXNYtyK4b19+vPDVipHNV+EG7EcZClk2kpg xOpLI4J14VZuHNLEFGg3Vpj8wfCPRSu0Czki6rALfH+Kni6NtU55FT4JroryZTsSXCRD rSOQ== 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:content-transfer-encoding :in-reply-to:user-agent; bh=+xW6ayc9M1wqdT6APwQxZ4pHhnuhNab/rKvwVWqJfao=; b=DXsdBJuDTxEdDh8dQbV9mRlorz96SB1RjnTWyabYONYV6cEYC5Fc2C2k3RP0mOUp2c IEp/duL85F8/52C9myg8y4zFJecjgIsWsfuuuuq6WSMcDL0eqDJVJuvNET0iVgNnEraT WGnVz12JeLBifDQm4oupKXwb8Owfv0GF/EroPnYn3R7kMP5XG5TfAIwYoI+5LVtvB2FJ bzXZREyH/hx47nqRC04y9BY/Zo6rUjZ87xzqNcCczo7TTVgZKGsFzc//3sJXIIOBhQCc bsJRFe0UnDsoZnu7VS6eC9yLsSCJYYT4tqq5X+1gRLwMwa0DTK0B7Wc/GLcYfuXj9/8t bGfw== X-Gm-Message-State: AHPjjUgyJGPChHxflupAkNkgIe0qFsvqLJcT9aHzogzbCbO+btEX1D2a 33mIhRf+Y5+BUk1M X-Google-Smtp-Source: AOwi7QDOdQ5b2tZ62Vbmm3e9WeW3mewKU2v5r3ZNUZuqnLKCflYTYLQvwkbFoSildwbIF1GDFD2wgA== X-Received: by 10.200.39.174 with SMTP id w43mr33600623qtw.154.1505488561193; Fri, 15 Sep 2017 08:16:01 -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 a50sm683331qtc.87.2017.09.15.08.15.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Sep 2017 08:16:00 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id 6B4E669FB3; Fri, 15 Sep 2017 11:15:59 -0400 (EDT) Content-Disposition: inline In-Reply-To: <831sn8m66n.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22f 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:218325 Archived-At: On 15/09/17 at 04:40pm, Eli Zaretskii wrote: > > From: Mark Oteiza > > Date: Thu, 14 Sep 2017 15:43:28 -0400 > > Cc: emacs-devel@gnu.org > > > > At the very least we should feed metrics the translated RGBs. > > Yes. But it would be nicer if the lcms.c functions accepted colors in > any form supported by Emacs: a color name, a string RGB spec, or a > list of RGB values. I think. > > > Beyond that, in order to use (for example) lcms2-cam02-ucs with > > color-distance, one has to translate RGB to XYZ, so the metric would be > > > > (lambda (a b) > > (lcms2-cam02-ucs (color-srgb-to-xyz a) (color-srgb-to-xyz b)) > > color-srgb-to-xyz accepts 3 arguments, not one. Also, its doc string > says the components are floats between 0 and 1. So this should be > amended accordingly. Ah, yes I forget about color.el's calling conventions… (defun lcms-rgb16->rgb1 (color) (mapcar (lambda (x) (/ (lsh x -8) 255.0)) color)) (lambda (a b) (lcms-cam02-ucs (apply #'color-srgb-to-xyz (color-rgb16b->rgb1 a)) (apply #'color-srgb-to-xyz (color-rgb16b->rgb1 b))))