From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] New function: color-blend Date: Sat, 09 Nov 2024 10:13:31 -0800 Message-ID: <877c9c8ed0.fsf@breatheoutbreathe.in> References: <87wmhmgq4a.fsf@breatheoutbreathe.in> <86o72yyqxa.fsf@gnu.org> <87a5ehldm9.fsf@breatheoutbreathe.in> <86ikswn0pz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20282"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 09 19:17:35 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 1t9q1e-00056Y-LC for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Nov 2024 19:17:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9q0o-0007Ty-Ar; Sat, 09 Nov 2024 13:16:42 -0500 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 1t9py3-00075x-0R for emacs-devel@gnu.org; Sat, 09 Nov 2024 13:13:51 -0500 Original-Received: from out-187.mta1.migadu.com ([2001:41d0:203:375::bb]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9py0-0001WI-TK for emacs-devel@gnu.org; Sat, 09 Nov 2024 13:13:50 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1731176020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=boo/IFT88Gt1eyn1G7Dt64vDYCMYvYxir0P10eXC2Gc=; b=A6ep6VQ2mf4Wkx6a9p9E4LwD4qMfmQdIsyRGODJ5JK5r0r7JvvcD66fQBRWQ/GawaNRdFE Z9GgT/TgpJHBR9Gfkp+fwm4awpOUDXTkB7iVbJKnXtlutRkl1X1v1L9/d41JbVNZAuh1nL upFm3z/v48wrgtBn+UZtLUIW7CYOfaU= In-Reply-To: <86ikswn0pz.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 09 Nov 2024 12:46:48 +0200") X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:203:375::bb; envelope-from=joseph@breatheoutbreathe.in; helo=out-187.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 09 Nov 2024 13:16:40 -0500 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:325345 Archived-At: Eli Zaretskii writes: >> From: Joseph Turner >> Cc: emacs-devel@gnu.org >> Date: Sat, 02 Nov 2024 11:00:46 -0700 >>=20 >> Eli Zaretskii writes: >>=20 >> >> From: Joseph Turner >> >> Date: Fri, 01 Nov 2024 22:29:41 -0700 >> >>=20 >> >> Here's `color-blend', a function to blend two colors into one. The >> >> patchset also replaces `vtable--color-blend' with `color-blend'. >> >>=20 >> >> Examples of this function being implemented separately in the wild: >> >>=20 >> >> https://github.com/alphapapa/prism.el/blob/2fa8eb5a9ca62a548d33befef4= 517e5d0266eb28/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. >>=20 >> > From: Yuri Khan >> > Subject: Re: [PATCH] New function: color-blend >> > To: Joseph Turner >> > Cc: Emacs Devel Mailing List >> > Date: Sat, 2 Nov 2024 18:26:57 +0700 (6 hours, 32 minutes, 20 seconds = ago) >> > Flags: seen, personal >> > Maildir: /joseph-breatheoutbreathein/INBOX >>=20 >> > On Sat, 2 Nov 2024 at 14:03, Joseph Turner wrote: >>=20 >> > > Here's `color-blend', a function to blend two colors into one. >>=20 >> > It would be nice to explicitly mention linear RGB space. Most >> > users[citation needed] these days are accustomed to colors specified >> > in sRGB space and na=C3=AFve conversion dividing by 255 will not give = the >> > desired blends. As an example, linear mixing black (0 0 0) with white >> > (1 1 1) yields (0.5 0.5 0.5). Na=C3=AFve scaling will yield #808080 wh= ereas >> > middle gray is somewhere around #bebebe in sRGB. >>=20 >> Thanks for the feedback! Please see the attached revised patch. > > Thanks, installed on master. > > (I needed a few followup changes, as it looks like you ignored > byte-compilation warnings...) Thank you! I see the changes you made, and I'll byte compile before submitting patches next time. Joseph