NetBSD Problem Report #44109

From dholland@eecs.harvard.edu  Thu Nov 18 06:06:20 2010
Return-Path: <dholland@eecs.harvard.edu>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id BAC2263BA98
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 18 Nov 2010 06:06:19 +0000 (UTC)
Message-Id: <20101118060251.B5A2FF8FF@tanaqui.eecs.harvard.edu>
Date: Thu, 18 Nov 2010 01:02:51 -0500 (EST)
From: dholland@eecs.harvard.edu
Reply-To: dholland@eecs.harvard.edu
To: gnats-bugs@gnats.NetBSD.org
Subject: curses does not support full colour
X-Send-Pr-Version: 3.95

>Number:         44109
>Category:       lib
>Synopsis:       curses does not support full colour
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 18 06:10:00 +0000 2010
>Last-Modified:  Sat Nov 20 18:55:02 +0000 2010
>Originator:     David A. Holland
>Release:        NetBSD 5.99.39 (20101117)
>Organization:
>Environment:
System: NetBSD valkyrie 5.99.39 NetBSD 5.99.39 (VALKYRIE) #16: Wed Nov 17 16:50:52 EST 2010  dholland@valkyrie:/usr/src/sys/arch/amd64/compile/VALKYRIE amd64
Architecture: x86_64
Machine: amd64
>Description:

Curses does not let you use arbitrary RGB colors. The color support is
limited to the first 8 of the 16 DOS console colors from ANSI.SYS. As
most of these colors are ugly (particularly in combinations) this
makes it more or less impossible to take advantage of color in
text-based user interfaces.

>How-To-Repeat:

Try to improve the on-screen information density of a curses app by
using color. Watch your eyes fall out.

>Fix:

Not so trivial, even just on the client API side.

Ideally it would be possible to give each character its own RGB color
value; however, curses doesn't have enough attribute bits available.
This seems to suggest some kind of indexed colormap scheme, but then
one needs an API for managing the colormap, etc., etc. (And an 8 color
colormap almost certainly wouldn't be enough.)

I'm not sure what if any support the common terminal emulators have
for colors that aren't the ANSI.SYS colors. However, as we control the
console and can patch xterm if we want to, this should not be
construed as a barrier...

>Release-Note:

>Audit-Trail:

From: Brett Lymn <blymn@baea.com.au>
To: gnats-bugs@NetBSD.org
Cc: lib-bug-people@NetBSD.org, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: lib/44109: curses does not support full colour
Date: Thu, 18 Nov 2010 22:52:29 +1030

 On Thu, Nov 18, 2010 at 06:10:00AM +0000, dholland@eecs.harvard.edu wrote:
 > 
 > Curses does not let you use arbitrary RGB colors. 

 man can_change_color
 man init_color

 say different.  Though looking at the curses source, init_color has
 not been implemented yet.

 >The color support is
 > limited to the first 8 of the 16 DOS console colors from ANSI.SYS. As
 > most of these colors are ugly (particularly in combinations) this
 > makes it more or less impossible to take advantage of color in
 > text-based user interfaces.
 > 

 By default those colours are set up in curses but they are not the
 only ones that can be used.  The maximum number of colours available
 is a terminal dependent number (terminfo attribute max_colors) as is
 the number of colour pairs (terminfo attribute max_pairs).

 -- 
 Brett Lymn
 "Warning:
 The information contained in this email and any attached files is
 confidential to BAE Systems Australia. If you are not the intended
 recipient, any use, disclosure or copying of this email or any
 attachments is expressly prohibited.  If you have received this email
 in error, please notify us immediately. VIRUS: Every care has been
 taken to ensure this email and its attachments are virus free,
 however, any loss or damage incurred in using this email is not the
 sender's responsibility.  It is your responsibility to ensure virus
 checks are completed before installing any data sent in this email to
 your computer."


From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/44109: curses does not support full colour
Date: Thu, 18 Nov 2010 11:29:33 -0500

 On Thu, 18 Nov 2010 06:10:00 +0000 (UTC)
 dholland@eecs.harvard.edu wrote:

 > I'm not sure what if any support the common terminal emulators have
 > for colors that aren't the ANSI.SYS colors. However, as we control the
 > console and can patch xterm if we want to, this should not be
 > construed as a barrier...

 I agree that the default text-mode console colors aren't ideal.
 Fortunately, in X11 terminals those can easily be changed, however.
 For instance I use the following custom resources to specify the colors
 to use for xterm and urxvt, in case this can temporarily help
 (assuming you like those colors :)

 http://ftp.pulsar-zone.net/conf/DOTXdefaults

 As for the text-mode console, I don't even remember if the default text
 mode supports more than 16 colors... surely that framebuffers do,
 however.

 Thanks,
 -- 
 Matt

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/44109: curses does not support full colour
Date: Thu, 18 Nov 2010 20:28:10 +0000

 On Thu, Nov 18, 2010 at 12:25:02PM +0000, Brett Lymn wrote:
  >  > Curses does not let you use arbitrary RGB colors. 
  >  
  >  man can_change_color
  >  man init_color
  >  
  >  say different.  Though looking at the curses source, init_color has
  >  not been implemented yet.

 Er woops, I forgot about that from the last time we talked about this.

 anyway it doesn't actually *work* :-/

  >  By default those colours are set up in curses but they are not the
  >  only ones that can be used.

 ...but they currently are.

 ok, the state is better than I thought it was... what can I do to help
 make it work?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Brett Lymn <blymn@baea.com.au>
To: gnats-bugs@NetBSD.org
Cc: lib-bug-people@NetBSD.org, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
        dholland@eecs.harvard.edu
Subject: Re: lib/44109: curses does not support full colour
Date: Fri, 19 Nov 2010 09:19:35 +1030

 On Thu, Nov 18, 2010 at 08:30:06PM +0000, David Holland wrote:
 >  
 >  Er woops, I forgot about that from the last time we talked about this.
 >  
 >  anyway it doesn't actually *work* :-/
 >  

 No argument with that :)

 >  
 >  ok, the state is better than I thought it was... what can I do to help
 >  make it work?
 >  

 The quick read I had of the colour code it seems to me that most of
 the support is there we just need to make init_color() work which
 should be a matter of emitting the initialize_color attribute iff it
 is defined.  Probably the hardest bit will be working out what all the
 parameters are for initialize_color, having a look in the terminfo
 database source the escape string was rather impressive.

 -- 
 Brett Lymn
 "Warning:
 The information contained in this email and any attached files is
 confidential to BAE Systems Australia. If you are not the intended
 recipient, any use, disclosure or copying of this email or any
 attachments is expressly prohibited.  If you have received this email
 in error, please notify us immediately. VIRUS: Every care has been
 taken to ensure this email and its attachments are virus free,
 however, any loss or damage incurred in using this email is not the
 sender's responsibility.  It is your responsibility to ensure virus
 checks are completed before installing any data sent in this email to
 your computer."


From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/44109: curses does not support full colour
Date: Sat, 20 Nov 2010 18:52:04 +0000

 On Thu, Nov 18, 2010 at 10:50:05PM +0000, Brett Lymn wrote:
  >  The quick read I had of the colour code it seems to me that most of
  >  the support is there we just need to make init_color() work which
  >  should be a matter of emitting the initialize_color attribute iff it
  >  is defined.  Probably the hardest bit will be working out what all the
  >  parameters are for initialize_color, having a look in the terminfo
  >  database source the escape string was rather impressive.

 Hmm... I suppose this means that effects like color-cycling or fades
 aren't going to be possible?

 -- 
 David A. Holland
 dholland@netbsd.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.