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: Adding some convenience functions to color.el Date: Fri, 09 Jun 2023 10:34:35 +0300 Message-ID: <83sfb11438.fsf@gnu.org> References: <83v8fx15wq.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6238"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yilkal Argaw Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 09 09:35:22 2023 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 1q7WeY-0001Mk-1H for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Jun 2023 09:35:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7Wdi-0001xI-BA; Fri, 09 Jun 2023 03:34:30 -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 1q7Wdh-0001x2-E2 for emacs-devel@gnu.org; Fri, 09 Jun 2023 03:34:29 -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 1q7Wdg-0004XX-Sv; Fri, 09 Jun 2023 03:34:28 -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=hrgc6Vph825pn0vv5RqUyhfgGwUTNQ4epRIPEdxXcFs=; b=apUvV0Q0d7NX Jigo+tCzh39oMNI1bIInXcoRO0lLD94t9STZorsC4ekHHw0NWusxkMxgq6C1pTNzD/i5jZ6wAl+My AY3j5QQP4J64Izjjxm5AE1gb0o3/rVmULmDcwV01ouI88iqfDWiyrtUMCwfCRMEELbEiDNzhLbWNz UighHvCaDLK4hXBZSbH2a0fFhExjSKcKYyv5QdvpjDxBLyCQmF5XbDTGwUYYQfAZuEQsRxBOQzC/o +o4jmJ4ES0fbKxT/QwQJfwytTisPJVSGgfS5BTIzqwx8Xn1s1Vx9hWDZOaH8o+YgAOEHW3B82Ag+T JtwOeuhJi5oeSTrFVAAkTA==; 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 1q7Wdf-0003ZA-D2; Fri, 09 Jun 2023 03:34:28 -0400 In-Reply-To: (message from Yilkal Argaw on Fri, 9 Jun 2023 10:26:57 +0300) 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306707 Archived-At: > From: Yilkal Argaw > Date: Fri, 9 Jun 2023 10:26:57 +0300 > Cc: emacs-devel@gnu.org > > > From: Eli Zaretskii > > We already have color-dark-p (and color-name-to-rgb to complement it), > > so I'm not sure I understand the rationale for these functions. Can > > you explain more why you needed them? > > Sorry I totally missed color-dark-p. I did not check faces.el and color-dark-p was in faces.el. They are now documented in the ELisp manual. > Having color-name-to-hsl is just a convenience function to make it easier when working in some > color spaces. Because some operations are easier in certain color spaces. color.el already provides color-rgb-to-hsl and color-hsl-to-rgb, so you should be able to easily work in the HSL space, and still call functions that accept RGB arguments. IMO, we already have a large and rich collection of color-related functions, so adding more will run the risk to increase confusion and produce inconsistencies. (E.g., your proposed color-name-dark-p uses a threshold for dark vs light colors that is different from what we use in color-dark-p.)