emacs-devel
[Top][All Lists]
Advanced

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

Re: "modern" colors Re: Changes for emacs 28


From: Göktuğ Kayaalp
Subject: Re: "modern" colors Re: Changes for emacs 28
Date: Tue, 15 Sep 2020 19:30:23 +0300
User-agent: mu4e 1.2.0; emacs 28.0.50

On 2020-09-15 19:01 +03, Göktuğ Kayaalp <self@gkayaalp.com> wrote:
> On 2020-09-15 18:51 +03, Yuri Khan <yuri.v.khan@gmail.com> wrote:
>> Some time ago someone over at Bugzilla (Firefox’s bug tracker) said
>> it’s generally not possible to query about that.
>
> And yet they are able to use that information to set up their UI
> colours, and more interestingly they are able to relay that information
> via CSS such that the @media(prefers-color-scheme) works.
>
> Maybe it’s just heuristics then?

I think I found something relevant here [1] and indeed it seems they’re
just using heuristics to guess if the GTK theme is dark-ish:

    mSystemUsesDarkTheme =
        (RelativeLuminanceUtils::Compute(GDK_RGBA_TO_NS_RGBA(bg)) <
         RelativeLuminanceUtils::Compute(GDK_RGBA_TO_NS_RGBA(fg)));

[1] 
https://searchfox.org/mozilla-central/rev/0c97a6410ff018c22e65a0cbe4e5f2ca4581b22e/widget/gtk/nsLookAndFeel.cpp#1021-1023

-- 
İ. Göktuğ Kayaalp / @cadadr / <https://www.gkayaalp.com/>
pgp:   024C 30DD 597D 142B 49AC 40EB 465C D949 B101 2427



reply via email to

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