From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?R8O2a3R1xJ8=?= Kayaalp Newsgroups: gmane.emacs.devel Subject: Re: "modern" colors Re: Changes for emacs 28 Date: Tue, 15 Sep 2020 19:30:23 +0300 Message-ID: <871rj357fk.fsf@gkayaalp.com> References: <20200910102000.2t6tsju745xutg7u@Ergus> <20200912153723.ymnq3i5pugqf7lsy@Ergus> <871rj628mq.fsf@elephly.net> <20200912195358.3zjct7gsogjtlh3n@Ergus> <87y2lezrbp.fsf@elephly.net> <83pn6pbtni.fsf@gnu.org> <87mu1tzlxo.fsf@elephly.net> <83mu1tbp7a.fsf@gnu.org> <87h7s1zccb.fsf@elephly.net> <878sddz72o.fsf@elephly.net> <837dswbept.fsf@gnu.org> <87r1r4xq74.fsf@elephly.net> <83imcg9shm.fsf@gnu.org> <87a6xsxhry.fsf@elephly.net> <83wo0v85x8.fsf@gnu.org> <87363j58sg.fsf@gkayaalp.com> 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="23440"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.2.0; emacs 28.0.50 Cc: Ergus , Robert Pluim , Yuan Fu , emacs-devel@gnu.org, rekado@elephly.net, "Alfred M. Szmidt" , Stefan Monnier , Gregory Heytings , Eli Zaretskii , TEC To: =?utf-8?B?R8O2a3R1xJ8=?= Kayaalp Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 15 18:32:20 2020 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 1kIDsS-0005xS-9j for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Sep 2020 18:32:20 +0200 Original-Received: from localhost ([::1]:55270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIDsR-00065X-Bg for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Sep 2020 12:32:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIDqo-0005Al-K0 for emacs-devel@gnu.org; Tue, 15 Sep 2020 12:30:38 -0400 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:36843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIDqm-0005P5-Bu; Tue, 15 Sep 2020 12:30:38 -0400 Original-Received: from localhost (unknown [31.177.204.112]) (Authenticated sender: self@gkayaalp.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 69ECE200007; Tue, 15 Sep 2020 16:30:25 +0000 (UTC) In-reply-to: <87363j58sg.fsf@gkayaalp.com> Received-SPF: none client-ip=217.70.178.232; envelope-from=self@gkayaalp.com; helo=relay12.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/15 12:30:32 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:255769 Archived-At: On 2020-09-15 19:01 +03, G=C3=B6ktu=C4=9F Kayaalp wrote: > On 2020-09-15 18:51 +03, Yuri Khan wrote: >> Some time ago someone over at Bugzilla (Firefox=E2=80=99s bug tracker) s= aid >> it=E2=80=99s 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=E2=80=99s just heuristics then? I think I found something relevant here [1] and indeed it seems they=E2=80= =99re just using heuristics to guess if the GTK theme is dark-ish: mSystemUsesDarkTheme =3D (RelativeLuminanceUtils::Compute(GDK_RGBA_TO_NS_RGBA(bg)) < RelativeLuminanceUtils::Compute(GDK_RGBA_TO_NS_RGBA(fg))); [1] https://searchfox.org/mozilla-central/rev/0c97a6410ff018c22e65a0cbe4e5f= 2ca4581b22e/widget/gtk/nsLookAndFeel.cpp#1021-1023 --=20 =C4=B0. G=C3=B6ktu=C4=9F Kayaalp / @cadadr / pgp: 024C 30DD 597D 142B 49AC 40EB 465C D949 B101 2427