From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eli Zaretskii" Newsgroups: gmane.emacs.devel Subject: Re: face colors on 256 colors terminals Date: Wed, 06 Apr 2005 20:23:24 +0300 Message-ID: <01c53acd$Blat.v2.4$7c0f2080@zahav.net.il> References: <200504060817.j368HDAH019106@scanner2.ics.uci.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1112808597 30916 80.91.229.2 (6 Apr 2005 17:29:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Apr 2005 17:29:57 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 06 19:29:54 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DJEKd-0003Q5-3y for ged-emacs-devel@m.gmane.org; Wed, 06 Apr 2005 19:28:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DJDtl-0007BS-N9 for ged-emacs-devel@m.gmane.org; Wed, 06 Apr 2005 13:01:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DJDsr-0006Dt-4w for emacs-devel@gnu.org; Wed, 06 Apr 2005 13:00:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DJDsq-0006CO-I7 for emacs-devel@gnu.org; Wed, 06 Apr 2005 13:00:04 -0400 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DJEKk-0004V0-5S for emacs-devel@gnu.org; Wed, 06 Apr 2005 13:28:54 -0400 Original-Received: from zaretski (IGLD-80-230-67-97.inter.net.il [80.230.67.97]) by romy.inter.net.il (MOS 3.5.6-GR) with ESMTP id AXR02619 (AUTH halo1); Wed, 6 Apr 2005 20:27:55 +0300 (IDT) Original-To: Dan Nicolaescu X-Mailer: emacs 22.0.50 (via feedmail 8 I) and Blat ver 2.4 In-reply-to: <200504060817.j368HDAH019106@scanner2.ics.uci.edu> (message from Dan Nicolaescu on Wed, 06 Apr 2005 01:17:11 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:35645 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35645 > From: Dan Nicolaescu > Date: Wed, 06 Apr 2005 01:17:11 -0700 > > This comment in tty-colors.el:tty-color-standard-values > > ;; Translate the string "#XXYYZZ" into a list > ;; of numbers (XX YY ZZ). If the primary colors > ;; are specified with less than 4 hex digits, > ;; the used digits represent the most significant > ;; bits of the value (e.g. #XYZ = #X000Y000Z000). > > does not seem to match the way the `color-name-rgb-alist' seem to have > been created from the values in rgb.txt. > A random example: > >From color-name-rgb-alist: > ("lavenderblush" 65535 61680 62965) > ^^^^ ^^^^ ^^^^ > 0xffff 0xf0f0 0xf5f5 > > >From rgb.txt: lavender blush 255 240 245 > 0xff 0xf0 0xf5 > So the 8 to 16 bit conversion seems use the same byte value for both > the high and low byte value. The comment you cited reflects what I found in the X documentation. Here, for example, is an excerpt from the X(7) man page on a Debian GNU/Linux box (fencepost.gnu.org): For backward compatibility, an older syntax for RGB Device is supported, but its continued use is not encouraged. The syntax is an initial sharp sign character followed by a numeric specification, in one of the following formats: #RGB (4 bits each) #RRGGBB (8 bits each) #RRRGGGBBB (12 bits each) #RRRRGGGGBBBB (16 bits each) The R, G, and B represent single hexadecimal digits. When fewer than 16 bits each are specified, they represent the most-significant bits of the value (unlike the "rgb:" syn- tax, in which values are scaled). For example, #3a7 is the same as #3000a0007000. So I think the code in tty-colors.el is correct in this matter. It is, however, possible that the RGB values in color-name-rgb-alist were incorrectly scaled from 8-bit variants, and need to be amended. > With this fixes the gray colors are mapped linearly, and so are the > red1, blue1 and green1 colors (I checked the pixels in a screenshot). Does ``this fix'' above refer to the changes in xterm.el alone, or to the change in tty-colors.el as well? I think we should make the changes in xterm.el, but not in tty-colors.el. > Some standard face definitions use colors like "red" or "blue". They > should be changed "red1" (or "blue1") Yes, I agree. Can you post a patch to do that? > Thanks! And thank _you_ for working on this.