unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dan Nicolaescu <dann@ics.uci.edu>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: face colors on 256 colors terminals
Date: Wed, 06 Apr 2005 11:26:40 -0700	[thread overview]
Message-ID: <200504061826.j36IQgAH014283@scanner2.ics.uci.edu> (raw)
In-Reply-To: <x53bu3g63o.fsf@lola.goethe.zz> (David Kastrup's message of "Wed, 06 Apr 2005 19:36:27 +0200")

David Kastrup <dak@gnu.org> writes:

  > "Eli Zaretskii" <eliz@gnu.org> writes:
  > 
  > >> From: Dan Nicolaescu <dann@ics.uci.edu>
  > >> 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.
  > 
  > Actually, it does not make sense to scale in that way.  #3a7 really
  > should be the same as #3333aaaa7777, so that #fff is the same as
  > #ffffffffffff, pure white.

Hmmm, looking just a few lines above the lines Eli cited from the X
manual you can find this:

       The eight primary colors can be represented as:

           black                rgb:0/0/0
           red                  rgb:ffff/0/0
           green                rgb:0/ffff/0
           blue                 rgb:0/0/ffff
           yellow               rgb:ffff/ffff/0
           magenta              rgb:ffff/0/ffff
           cyan                 rgb:0/ffff/ffff
           white                rgb:ffff/ffff/ffff

So does this mean that 0xff is gets a special treatment when scaling? 
Or it means that the #3000a0007000 example is incorrect? 
Does anybody know? 

  parent reply	other threads:[~2005-04-06 18:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-06  8:17 face colors on 256 colors terminals Dan Nicolaescu
2005-04-06 17:23 ` Eli Zaretskii
2005-04-06 17:36   ` David Kastrup
2005-04-06 17:46     ` Eli Zaretskii
2005-04-06 18:03       ` David Kastrup
2005-04-06 18:26     ` Dan Nicolaescu [this message]
2005-04-07 20:43     ` James Cloos
2005-04-08  1:17       ` Dan Nicolaescu
2005-04-08 10:52         ` Eli Zaretskii
2005-04-08 15:13           ` Dan Nicolaescu
2005-04-09  8:06             ` Eli Zaretskii
2005-04-06 17:52   ` Dan Nicolaescu
     [not found]     ` <01c53aea$Blat.v2.4$16ee4740@zahav.net.il>
2005-04-06 23:50       ` Dan Nicolaescu
2005-04-07  0:22         ` David Kastrup
2005-04-07  3:58           ` Eli Zaretskii
2005-04-07  5:14           ` Dan Nicolaescu
2005-04-07 10:23             ` David Kastrup
2005-04-08  1:13               ` Dan Nicolaescu
2005-04-07  3:55         ` Eli Zaretskii
     [not found]   ` <200504062134.j36LY8AH022227@scanner2.ics.uci.edu>
2005-04-07  3:53     ` Eli Zaretskii
2005-04-07 18:27       ` Dan Nicolaescu
2005-04-08 10:54         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200504061826.j36IQgAH014283@scanner2.ics.uci.edu \
    --to=dann@ics.uci.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).