From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filippo Argiolas Newsgroups: gmane.emacs.devel Subject: Re: Foreground color opacity Date: Mon, 11 Sep 2023 15:09:45 +0200 Message-ID: References: <83fs3krhmi.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="8457"; 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 Mon Sep 11 15:10:45 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 1qfggd-0006zv-Ps for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Sep 2023 15:10:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfgg2-0008HW-6F; Mon, 11 Sep 2023 09:10:06 -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 1qfgfz-0008HH-2A for emacs-devel@gnu.org; Mon, 11 Sep 2023 09:10:03 -0400 Original-Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfgfw-0001vI-RG; Mon, 11 Sep 2023 09:10:02 -0400 Original-Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-570a432468bso3852227a12.0; Mon, 11 Sep 2023 06:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694437798; x=1695042598; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Oif+okRrj5FeWVQJPQikE4YOnZOwVt3l6/YxvQVvQc4=; b=h+MBW/XAEsP7xpDJ2VP9aG2oaRPiAhxmZAKyqWhmgkaIMQVqtLqJVimLwxQrnmVmM2 EgNv52q8cQXdkKwgLWIvPUpnJ2ONeIDpvWmuJ1YBWOb/b1Y4MFXhY8+3djyyd4O8CeSz cMkAJ2e2X3jdOjJLlAcd/GXnPx8Jyi4vOQdZlGw3UQNRIjFOliwF82T86/5E7k3PIeG3 IMelVK2MkcXhCxxsjt92Iky0Ls8VameOwnHjwW8Nnf7sITvmD3GgIqFo4RvgrfeNohzW QXNKWa+L2KDsoiZD3k613ZHKoPxXV8o+s9jnNn2hhEWUrGj4ay1FQhe1f/P7gZP2DMew YKOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694437798; x=1695042598; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Oif+okRrj5FeWVQJPQikE4YOnZOwVt3l6/YxvQVvQc4=; b=vclvi7SwTBWrq1X4S+syBdhAXvmrD/Qt/8bloVgd4FBz6kTJc29ciLN5K3b0s9FIC7 FFIZ1DTBw2PErhNkKIynidITZVq9m16c/ZX45bS09oXdYZWCOohzEygnsW8M+jWoNGXx S1RJ3EaZSeA9uweZbUxSdKpDBCOpwKc2CdRoOiONyYH8nmmw3G5+AMtd66qZqbJkieT+ B1cOlX6cAOlcz3312NjDts8nzqWGBk2A7LRixm8ntchdPd5hV3KmF2rI1iCSM+ZmcKd9 Bmo27EhWtETTWFOHijvPpdLUCxkL/LSqog+K74aNc/6hm82gCfHSrILtxpuT+Qp3trpW 1twQ== X-Gm-Message-State: AOJu0YyXTvNhFOFJB7D/d01fs9oCkTK8JA6lv4maGQQPzYSE5N24fmAy +6XcPTR0SQPZtUcJJ+q3xj02iZWShmIaMJzyYp005vYk X-Google-Smtp-Source: AGHT+IHPbikyWO8Hed4BsTfvhRk5KbKjAY9IH55fn28ObmjaX2ORo1/SYKd+p8DD206jkX859a+dgu4lYr5VZY7viUg= X-Received: by 2002:a17:90a:7527:b0:269:4fe8:687 with SMTP id q36-20020a17090a752700b002694fe80687mr13718781pjk.19.1694437797758; Mon, 11 Sep 2023 06:09:57 -0700 (PDT) In-Reply-To: <83fs3krhmi.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=filippo.argiolas@gmail.com; helo=mail-pg1-x52d.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:310485 On Mon, Sep 11, 2023 at 2:59=E2=80=AFPM Eli Zaretskii wrote: > > > 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. That would be the perfect solution, but as far as I can tell we don't have an opacity face attribute, do we? Filippo