bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#46493: [feature/pgtk] Low contrast region face


From: Lars Ingebrigtsen
Subject: bug#46493: [feature/pgtk] Low contrast region face
Date: Fri, 17 Jun 2022 15:41:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Yuuki Harano <masm+emacs@masm11.me> writes:

> This issue is not pgtk-specific.
>
> If we want another color for bg on pgtk, we can change this face definition 
> as follows:

The proposed patch was:

diff --git a/lisp/faces.el b/lisp/faces.el
index d92569e7cd..de1ca095aa 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2502,7 +2502,9 @@ highlight
 (defface region
   '((((class color) (min-colors 88) (background dark))
      :background "blue3" :extend t)
-    (((class color) (min-colors 88) (background light) (type gtk))
+     (((class color) (min-colors 88) (background light) (type pgtk))
+     :background "lightgoldenrod2" :extend t)
+     (((class color) (min-colors 88) (background light) (type gtk))
      :distant-foreground "gtk_selection_fg_color"
      :background "gtk_selection_bg_color" :extend t)
     (((class color) (min-colors 88) (background light) (type ns))

But...  The gtk_selection_fg_color colour is different under gtk, but not
pgtk -- that's the problem.

Poking at this, it seems the colours we get out of GTK are:

gtk_selection_bg_color 0.964706 0.960784 0.956863

Which is a very, very light colour, which is apparently calculated
correctly in this branch here:

#ifndef HAVE_PGTK
  sprintf (buf, "rgb:%04x/%04x/%04x", r, g, b);
  success_p = x_parse_color (f, buf, color) != 0;
#else
  sprintf (buf, "#%04x%04x%04x", r, g, b);
  success_p = pgtk_parse_color (f, buf, color) != 0;
#endif

But with the non-pgtk branch we get a very dark colour.  And when taking
this into account:

      /* FIXME: Retrieving the background color is deprecated in
         GTK+ 3.16.  New versions of GTK+ don't use the concept of a
         single background color any more, so we shouldn't query for
         it.  */
      gtk_style_context_get (gsty, state,
                             GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &c,
                             NULL);

I think we should just remove all of this code and use the same colours
in (p)GTK Emacsen as in non.

Any other opinions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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