From: Drew Adams <drew.adams@oracle.com>
To: Jim Porter <jporterbugs@gmail.com>,
Stefan Kangas <stefankangas@gmail.com>,
Dov Grobgeld <dov.grobgeld@gmail.com>,
emacs-devel <emacs-devel@gnu.org>
Subject: RE: [External] : Re: [PATCH] color-hsv-to-rgb
Date: Thu, 19 Oct 2023 20:12:47 +0000 [thread overview]
Message-ID: <SJ0PR10MB5488E8418767B0D4F0969BFCF3D4A@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <4fdf4589-54ab-21a1-1687-cd52e85fc540@gmail.com>
> For what it's worth, I thought about adding this function too. I would
> use it for a custom theme to choose colors for 'vc-annotate'. My
> hypothetical code would take a starting color (in RGB), convert to HSV,
> and then increment the value component to produce gradually lighter
> colors. After that, I'd need a way to convert back to RGB to make the
> hex string for the face attribute, hence this new function.
Yes. It should have been added long ago.
It's been available in hexrgb.el since 2005.
And hexrgb.el was offered to GNU Emacs.
And color.el was derived from hexrgb.el.
https://www.emacswiki.org/emacs/download/hexrgb.el
And you don't need to go to RGB to get
the hex RGB representation from HSV:
hexrgb-hsv-to-hex is a compiled Lisp function in ‘hexrgb.el’.
(hexrgb-hsv-to-hex HUE SATURATION VALUE &optional NB-DIGITS)
Return the hex RBG color string for inputs HUE, SATURATION, VALUE.
Those inputs are each in the range 0.0 to 1.0, inclusive.
Optional arg NB-DIGITS is the number of hex digits per component. It
should be 1, 2, 3, or 4 (default: 4).
The output string is `#' followed by NB-DIGITS hex digits for each
color component. So for the default NB-DIGITS value of 4, the form is
"#RRRRGGGGBBBB".
next prev parent reply other threads:[~2023-10-19 20:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-16 7:28 [PATCH] color-hsv-to-rgb Dov Grobgeld
2023-10-16 7:59 ` Stefan Kangas
2023-10-19 19:58 ` Jim Porter
2023-10-19 20:12 ` Drew Adams [this message]
2023-10-19 21:22 ` [External] : " Stefan Kangas
2023-10-19 21:35 ` Drew Adams
2023-10-20 6:09 ` Eli Zaretskii
2023-10-20 15:04 ` Drew Adams
2023-10-20 17:59 ` Eli Zaretskii
2023-10-16 12:05 ` Eli Zaretskii
2023-10-17 6:12 ` Dov Grobgeld
-- strict thread matches above, loose matches on Subject: below --
2023-10-20 21:04 [External] : " Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SJ0PR10MB5488E8418767B0D4F0969BFCF3D4A@SJ0PR10MB5488.namprd10.prod.outlook.com \
--to=drew.adams@oracle.com \
--cc=dov.grobgeld@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=jporterbugs@gmail.com \
--cc=stefankangas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.