emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] New function: color-blend


From: Eli Zaretskii
Subject: Re: [PATCH] New function: color-blend
Date: Sat, 02 Nov 2024 10:34:57 +0200

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]