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: emacs, true color and iterm2 Date: Tue, 10 Sep 2013 18:15:31 +0300 Message-ID: <83hadsk8rw.fsf@gnu.org> References: <83li35kbuz.fsf@gnu.org> <83ioy9jsnd.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1378826150 464 80.91.229.3 (10 Sep 2013 15:15:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Sep 2013 15:15:50 +0000 (UTC) Cc: fxbois@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 10 17:15:52 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VJPfT-0006uU-Ga for ged-emacs-devel@m.gmane.org; Tue, 10 Sep 2013 17:15:51 +0200 Original-Received: from localhost ([::1]:58595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJPfT-00018Q-29 for ged-emacs-devel@m.gmane.org; Tue, 10 Sep 2013 11:15:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJPfI-00018I-Pw for emacs-devel@gnu.org; Tue, 10 Sep 2013 11:15:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJPfD-0006ZX-LK for emacs-devel@gnu.org; Tue, 10 Sep 2013 11:15:40 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:36113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJPfD-0006ZQ-D0 for emacs-devel@gnu.org; Tue, 10 Sep 2013 11:15:35 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MSX001000L5HN00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Tue, 10 Sep 2013 18:15:33 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MSX001MZ11TLF10@a-mtaout20.012.net.il>; Tue, 10 Sep 2013 18:15:29 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163285 Archived-At: > From: Stefan Monnier > Cc: fxbois@gmail.com, emacs-devel@gnu.org > Date: Tue, 10 Sep 2013 10:57:31 -0400 > > >> > Tho, obviously, for 2bit color support, we won't will want to have > >> ^ ^^^^^ > >> 24 [delete] > >> > >> > support for tty colors without going through some approximation table. > > Now I completely misunderstand what you mean by that, and why. > > AFAIK, currently, color support in a tty goes through an approximation > step which choose the closest color number to use among the N colors > supported by the tty. Only as fallback. An exact match is tried first, and if it exists, it is always used. > We'll want to skip this step if the terminal supports 24bit colors, > since the table would be both huge (16M entries) and useless. You already assume that Someone(TM) will generate such a huge table. But that's not guaranteed, and if I were the person to do the job, I'd only make a list for the 256 standard colors. In any case, the alist of supported colors is used not only for approximating colors, but also for mapping color names and RGB values to integer numbers that need to be sent to the terminal driver. This same alist is used to find the exact match, if it exists. So you need such an alist anyway, unless you want to invent a completely different API for talking to a TTY.