From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Question: How does color-lighten-name work? Date: Fri, 28 Oct 2022 14:26:37 +0300 Message-ID: <83h6zojij6.fsf@gnu.org> References: <83r0ysjufl.fsf@gnu.org> <875yg4s71v.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2882"; mail-complaints-to="usenet@ciao.gmane.io" Cc: paaguti@gmail.com, emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 28 13:28:00 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ooNWp-0000Ux-UO for ged-emacs-devel@m.gmane-mx.org; Fri, 28 Oct 2022 13:28:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooNVd-0000IH-TM; Fri, 28 Oct 2022 07:26:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooNVb-0000Fr-Ih for emacs-devel@gnu.org; Fri, 28 Oct 2022 07:26:43 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooNVb-0001xD-BK; Fri, 28 Oct 2022 07:26:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NW4UPnHpYpfv2+YM4TjEyum6oeWny4y7dNdGIQmdzkM=; b=o3S/VBfwFpph IBodmBAnKxDRpVlZHeBGVtbQ9NyresJzL8LsXR0HbdcPCQFF82/xaZ2nAXaBWg0hrN+XHO/8bxapg 4//mnGO0QiROkYt9tdBKlyU2ZB18YNUlhx7DbsqGrUyVJIlnjkqrcGqA6+DoynHcZrtxmohtDabX/ Rm8SkcAWBOI7lljcoDzKeHGbLcJ7IrEK9evYrT1EhAjiWMNOoPNtoHKDG+m3sjjaby6On2FdnEjSz abiRmfDe/fi3x7sZYmb+ZQcI+uyRGDsLnxeUTt5cPqm7uJ+RYMttOc2DCS+CA1xyYLus1L4l/in6F 44XedwL1vcoGEfYjs/GOiw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooNVa-0004st-IR; Fri, 28 Oct 2022 07:26:42 -0400 In-Reply-To: <875yg4s71v.fsf@gmail.com> (message from Robert Pluim on Fri, 28 Oct 2022 10:09:48 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298668 Archived-At: > From: Robert Pluim > Cc: Pedro Andres Aranda Gutierrez , emacs-devel@gnu.org > Date: Fri, 28 Oct 2022 10:09:48 +0200 > > >>>>> On Fri, 28 Oct 2022 10:09:34 +0300, Eli Zaretskii said: > > >> From: Pedro Andres Aranda Gutierrez > >> Date: Fri, 28 Oct 2022 08:23:16 +0200 > >> > >> (require 'color) > >> (let ((newbg "#102030")) > >> (message "newbg: %s" newbg) > >> (setq newbg (color-lighten-name newbg 10)) > >> (message "newbg: %s" newbg)) > >> > >> evaluated in the *scratch* buffer. will print the following: > >> > >> newbg: #102030 > >> newbg: #11ab23563501 > >> > >> Shouldn't the second colour spec have only 3 bytes? > > Eli> No, it uses the default format of 4 digits per component. > > Eli> We could perhaps add an additional optional argument to specify how > Eli> many digits per component to produce. > > By the principle of least surprise, perhaps default to the same number > of digits as the input? That'd be a backwards-incompatible change. Too late for that, I think. So if we introduce that, it will have to be via the additional argument. (FWIW, I see no surprise in the current behavior; I was actually surprised that it was surprising. You do understand that the #RGB notations are equivalent no matter how many bits per component we show, yes?)