[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding some convenience functions to color.el
From: |
Eli Zaretskii |
Subject: |
Re: Adding some convenience functions to color.el |
Date: |
Fri, 09 Jun 2023 10:34:35 +0300 |
> From: Yilkal Argaw <yilkalargawworkneh@gmail.com>
> Date: Fri, 9 Jun 2023 10:26:57 +0300
> Cc: emacs-devel@gnu.org
>
> > From: Eli Zaretskii <eliz@gnu.org>
> > 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.)