unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Joseph Turner <joseph@breatheoutbreathe.in>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] New function: color-blend
Date: Sat, 02 Nov 2024 10:34:57 +0200	[thread overview]
Message-ID: <86o72yyqxa.fsf@gnu.org> (raw)
In-Reply-To: <87wmhmgq4a.fsf@breatheoutbreathe.in> (message from Joseph Turner on Fri, 01 Nov 2024 22:29:41 -0700)

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Fri, 01 Nov 2024 22:29:41 -0700
> 
> Here's `color-blend', a function to blend two colors into one.  The
> patchset also replaces `vtable--color-blend' with `color-blend'.
> 
> Examples of this function being implemented separately in the wild:
> 
> https://github.com/alphapapa/prism.el/blob/2fa8eb5a9ca62a548d33befef4517e5d0266eb28/prism.el#L1044
> https://oremacs.com/2015/04/28/blending-faces/

Thanks.

> +---
> +** New function 'color-blend'.
> +This function blends two RGB lists into one.

This should explain what the function does, in terms that are clear
even to those who are not experts in this area.  AFAIU, "color
blending" has at least two different meanings.

> +(defun color-blend (a b &optional alpha)
> +  "Blend the two colors A and B with ALPHA.
> +A and B should be lists (RED GREEN BLUE), where each element is
> +between 0.0 and 1.0, inclusive.  ALPHA controls the influence A
> +has on the result and should be between 0.0 and 1.0, inclusive."

The doc string should document the return value.  Perhaps an example
of blending will also be a good addition to the doc string.



  reply	other threads:[~2024-11-02  8:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-02  5:29 [PATCH] New function: color-blend Joseph Turner
2024-11-02  8:34 ` Eli Zaretskii [this message]
2024-11-02 18:00   ` Joseph Turner
2024-11-09 10:46     ` Eli Zaretskii
2024-11-09 18:13       ` Joseph Turner
2024-11-02 11:26 ` Yuri Khan

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86o72yyqxa.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=joseph@breatheoutbreathe.in \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).