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: [PATCH] New function: color-blend Date: Sat, 02 Nov 2024 10:34:57 +0200 Message-ID: <86o72yyqxa.fsf@gnu.org> References: <87wmhmgq4a.fsf@breatheoutbreathe.in> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8233"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Joseph Turner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 02 09:36:10 2024 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 1t79c9-00020r-0D for ged-emacs-devel@m.gmane-mx.org; Sat, 02 Nov 2024 09:36:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t79bO-00076O-Ax; Sat, 02 Nov 2024 04:35:23 -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 1t79bI-000757-L8 for emacs-devel@gnu.org; Sat, 02 Nov 2024 04:35:16 -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 1t79bH-0007MB-06; Sat, 02 Nov 2024 04:35:16 -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=euY886Wjf+9KD39vEHUUTsRtlZ5lHY6zwIlnMkyh4Z0=; b=JyvUkow0rkyf XzeCvWE3lpw9VOLXFgBFYDkUd2ac9UkT6IFDni0u0uSdH4yN78F7/RXKTDTw9B2TmIKhAtm/p4k00 KyDNhsdujGrdZmhWoYCoHc/L+YkMglPCXr25f39ME6jCqpMZj4C1wFZlnib5jQBc0k2uKCS+MnDn1 8HtBxa87Lz1yIZlo9uYVzIsdfo+5k8GBIe4cMJ+eYFvIJrWlw8SwaP+9D9XT6OA7Jf94TLXw19k/h 8+KaglbtcjLcza5ekswlq2xOvTunWfFMqZZtsi5SZHam+NQbgp//ZeBRR1YV2pEpk17UJsptoHyQS VzK1uM6q3OHJ532qLNDJeQ==; In-Reply-To: <87wmhmgq4a.fsf@breatheoutbreathe.in> (message from Joseph Turner on Fri, 01 Nov 2024 22:29:41 -0700) 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:325004 Archived-At: > From: Joseph Turner > 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.