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: Foreground color opacity Date: Mon, 11 Sep 2023 15:58:45 +0300 Message-ID: <83fs3krhmi.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23409"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Filippo Argiolas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 11 14:59:46 2023 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 1qfgVt-0003Oe-Jw for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Sep 2023 14:59:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfgVb-0002pA-Kx; Mon, 11 Sep 2023 08:59:19 -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 1qfgVS-0002oF-2V for emacs-devel@gnu.org; Mon, 11 Sep 2023 08:59:11 -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 1qfgVO-0008A2-Gi; Mon, 11 Sep 2023 08:59:09 -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=FNWhiAoDIapJ+7zamAFPr13MayHEXX7jeMIX1xpTyIo=; b=fbms0+Cvpo9B IEwDzvwTNXp4NtGI0dAwWy+fd0JHcHbdvLaU+ZSRDdNM0UP0jAmV/1MnL0YdA8kQjg5HaQnT3uKEy +CugmAtnwSGUqTOzsX8bzZKoRUQ7WFYJPgm3+U82m20XJ3VNm7bOA400DCPlv1nxCA/klElcnvzYI hTjCH2huZtHH5LoO38DI6hZBH8lnMLsxgyr//1N5B7RVazOXnVBuAS5xHiHjgRUVG72Q2rcx8O6KZ 3jF9yzOn6qFmdn7+vpNCl4/FmVs7fb0TyP0gBYj4vsZS1wIE4asEZQq1Gyf8AwFPHR7K9iT3vC5D9 VDlBQUDrioeo3YKH/7yfGw==; In-Reply-To: (message from Filippo Argiolas on Mon, 11 Sep 2023 12:45:04 +0200) 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:310484 > From: Filippo Argiolas > Date: Mon, 11 Sep 2023 12:45:04 +0200 > > My approach so far has been something like this: > - label inactive regions with a dedicated text property > - add a function that runs after fontify-lock-fontify-region-function > (after so we run when we have fortified text with font lock faces) > - inside the fontify function detect face changes in the inactive > region and for each different face encountered apply a new one with > foreground color computed blending current foreground and background > > It seems to work so far and I like the result, but I keep thinking > it's overly complicated for something so simple as setting text > opacity. I'm pretty new to emacs lisp, am I missing a face attribute I > can just set in an overlay and get the same result? Wouldn't it make > sense to have something like this at backend level if it doesn't exist > yet? Why not cover the "inactive" portion with an overlay which has the 'face' (or font-lock-face) property that specifies only the opacity? That is IMO simpler and doesn't need to run any functions after fontifications. (Caveat: I didn't actually try this approach, so maybe I'm missing something.) Thanks.