From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Use 65535 as scale factor for color-values on NS Date: Sat, 6 Jun 2020 11:57:03 +0200 Message-ID: <144C70D7-33AA-4840-89A6-205F1EDF4847@acm.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_639AFEBB-7C27-4C9A-83B6-97902293D195" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="95807"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 06 12:10:55 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 1jhVmw-000Ot8-3t for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jun 2020 12:10:54 +0200 Original-Received: from localhost ([::1]:54476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhVmv-0008CM-6g for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jun 2020 06:10:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhVmQ-0007lv-Tn for emacs-devel@gnu.org; Sat, 06 Jun 2020 06:10:22 -0400 Original-Received: from mail1466c50.megamailservers.eu ([91.136.14.66]:37110 helo=mail268c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhVmO-0001gG-Hm for emacs-devel@gnu.org; Sat, 06 Jun 2020 06:10:22 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1591437426; bh=PRB7eJSWP9pDn6gmSgEUAeADYDRt/kj7rqsc+NQT+iU=; h=From:Subject:Date:Cc:To:From; b=IwvM+Nj0jQXOjzfI1Ly7rcHZvqgc5RKg6cUr0xHrAWstmXlamciWQiBdCuBxCSllt bVBkw60DQS4f2g1wpCnsGnCusQPSTw3fTAizE9sdLb6eUJ7Z9OWFWGfNO9b1SW9GNF igNgXKTQReYqXtKSkz5GdSUAfboNVHIElmfyZw2Y= Feedback-ID: mattiase@acm.or Original-Received: from stanniol.lan (c-4e4ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.78]) (authenticated bits=0) by mail268c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 0569v4WZ012194; Sat, 6 Jun 2020 09:57:05 +0000 X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F1C.5EDB6822.0034:SCFSTAT68638221, ss=1, re=-4.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: -4.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=BZ+mLYl2 c=1 sm=1 tr=0 a=klNLuyVZdLUgl+K5Uafb2A==:117 a=klNLuyVZdLUgl+K5Uafb2A==:17 a=M51BFTxLslgA:10 a=22mPQ_lD_N0CwAd5RO0A:9 a=CjuIK1q_8ugA:10 a=e95U5ltlPHoIN1d-EaIA:9 a=B2y7HmGcmWMA:10 a=pHzHmUro8NiASowvMSCR:22 a=nt3jZW36AmriUCFCBwmW:22 Received-SPF: softfail client-ip=91.136.14.66; envelope-from=mattiase@acm.org; helo=mail268c50.megamailservers.eu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/06 06:10:18 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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:251941 Archived-At: --Apple-Mail=_639AFEBB-7C27-4C9A-83B6-97902293D195 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Alan, it seems that only NS uses 65280 as scale factor for = 'color-values'; all other back-ends use 65535. Do you know if there is = any reason for keeping it this way? Otherwise, I propose we change it = (see patch). It is probably just a relic from when colour components were scaled from = 8 to 16 bits by multiplication with 256 instead of 257; this seems to = have been fixed everywhere else. --Apple-Mail=_639AFEBB-7C27-4C9A-83B6-97902293D195 Content-Disposition: attachment; filename=0001-Use-65535-as-color-values-scale-value-in-the-NS-back.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Use-65535-as-color-values-scale-value-in-the-NS-back.patch" Content-Transfer-Encoding: quoted-printable =46rom=20fba2c0d5f93c05db580b3aa7c8eda7a282411796=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Sat,=206=20Jun=202020=2011:23:48=20+0200=0A= Subject:=20[PATCH]=20Use=2065535=20as=20color-values=20scale=20value=20= in=20the=20NS=20backend=0A=0A*=20src/nsfns.m=20(Fxw_color_values):=20= Scale=20with=2065535=20instead=20of=2065280,=20for=0Auniformity=20with=20= other=20backends.=0A*=20lisp/faces.el=20(color-values):=20Update=20doc=20= string.=0A*=20doc/lispref/frames.texi=20(Color=20Names):=20Update=20= examples.=0A---=0A=20doc/lispref/frames.texi=20|=206=20+++---=0A=20= lisp/faces.el=20=20=20=20=20=20=20=20=20=20=20|=202=20+-=0A=20= src/nsfns.m=20=20=20=20=20=20=20=20=20=20=20=20=20|=204=20++--=0A=203=20= files=20changed,=206=20insertions(+),=206=20deletions(-)=0A=0Adiff=20= --git=20a/doc/lispref/frames.texi=20b/doc/lispref/frames.texi=0Aindex=20= 6bf5db2aa1..966f620558=20100644=0A---=20a/doc/lispref/frames.texi=0A+++=20= b/doc/lispref/frames.texi=0A@@=20-3975,11=20+3975,11=20@@=20Color=20= Names=0A=20(color-values=20"black")=0A=20=20=20=20=20=20@result{}=20(0=20= 0=200)=0A=20(color-values=20"white")=0A-=20=20=20=20=20@result{}=20= (65280=2065280=2065280)=0A+=20=20=20=20=20@result{}=20(65535=2065535=20= 65535)=0A=20(color-values=20"red")=0A-=20=20=20=20=20@result{}=20(65280=20= 0=200)=0A+=20=20=20=20=20@result{}=20(65535=200=200)=0A=20(color-values=20= "pink")=0A-=20=20=20=20=20@result{}=20(65280=2049152=2051968)=0A+=20=20=20= =20=20@result{}=20(65535=2049344=2052171)=0A=20(color-values=20"hungry")=0A= =20=20=20=20=20=20@result{}=20nil=0A=20@end=20example=0Adiff=20--git=20= a/lisp/faces.el=20b/lisp/faces.el=0Aindex=20e707f6f4b6..f4a9dedd79=20= 100644=0A---=20a/lisp/faces.el=0A+++=20b/lisp/faces.el=0A@@=20-1822,7=20= +1822,7=20@@=20color-values=0A=20string=20specifying=20a=20color's=20RGB=20= components=20(e.g.=20\"#ff12ec\").=0A=20=0A=20Return=20a=20list=20of=20= three=20integers,=20(RED=20GREEN=20BLUE),=20each=20between=200=0A-and=20= either=2065280=20or=2065535=20(the=20maximum=20depends=20on=20the=20= system).=0A+and=2065535=20inclusive.=0A=20Use=20`color-name-to-rgb'=20if=20= you=20want=20RGB=20floating-point=20values=0A=20normalized=20to=201.0.=0A= =20=0Adiff=20--git=20a/src/nsfns.m=20b/src/nsfns.m=0Aindex=20= 273fb5f759..5e8d572d8f=20100644=0A---=20a/src/nsfns.m=0A+++=20= b/src/nsfns.m=0A@@=20-2329,8=20+2329,8=20@@=20Frames=20are=20listed=20= from=20topmost=20(first)=20to=20bottommost=20(last).=20=20*/)=0A=20=20=20= [[col=20colorUsingDefaultColorSpace]=0A=20=20=20=20=20=20=20=20=20= getRed:=20&red=20green:=20&green=20blue:=20&blue=20alpha:=20&alpha];=0A=20= =20=20unblock_input=20();=0A-=20=20return=20list3i=20(lrint=20(red=20*=20= 65280),=20lrint=20(green=20*=2065280),=0A-=09=09=20lrint=20(blue=20*=20= 65280));=0A+=20=20return=20list3i=20(lrint=20(red=20*=2065335),=20lrint=20= (green=20*=2065535),=0A+=09=09=20lrint=20(blue=20*=2065535));=0A=20}=0A=20= =0A=20=0A--=20=0A2.21.1=20(Apple=20Git-122.3)=0A=0A= --Apple-Mail=_639AFEBB-7C27-4C9A-83B6-97902293D195--