Improve Console Colors

Bug #730672 reported by Dustin Kirkland 
92
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Newt
Fix Released
Undecided
bogl (Ubuntu)
Fix Released
Wishlist
Dustin Kirkland 
Natty
Fix Released
Wishlist
Dustin Kirkland 
cdebconf (Ubuntu)
Fix Released
Medium
Dustin Kirkland 
Natty
Fix Released
Medium
Dustin Kirkland 
console-setup (Ubuntu)
Fix Released
Wishlist
Dustin Kirkland 
Natty
Fix Released
Wishlist
Dustin Kirkland 
kbd (Debian)
Fix Released
Unknown
kbd (Ubuntu)
Fix Released
Wishlist
Dustin Kirkland 
Natty
Fix Released
Wishlist
Dustin Kirkland 
newt (Ubuntu)
Fix Released
Wishlist
Dustin Kirkland 
Natty
Fix Released
Wishlist
Dustin Kirkland 
rootskel (Ubuntu)
Fix Released
Wishlist
Dustin Kirkland 
Natty
Fix Released
Wishlist
Dustin Kirkland 

Bug Description

Binary package hint: kbd

The Linux virtual terminals support 16 colors, which are configurable in:
 /sys/module/vt/parameters/default_{red,grn,blu}

A well formed color map, cmap, can be dynamically set using the ioctl:
 ioctl(/dev/tty0, PIO_CMAP, cmap)

It would be very Ubuntu of us to provide a program in /sbin/setvtrgb that dynamically modifies these colors. Furthermore, we should provide a better default color palette than the standard vga one, allow admins to configure it, and apply it at boot.

------------------------------------------------------------------------

Order of uploads:
 1) kbd -- establish the setvtrgb utility, get it in the builds, is able to set the original vga colors, but requires a text file input palette

 2) Wait for Marcus/Ivanka to supply a suitable color palette

 3)
   a) console-setup -- add the conffile for the color palette, and the upstart job that calls setvtrgb it at boot
   b) rootskel -- call setvtrgb at install boot
   c) bogl -- fix the hardcoded color palette used by d

 4)
    a) newt -- change the default newt palette to use magenta where we previously used blue

------------------------------------------------------------------------

Eventually (11.10?) we should try to apply the Ubuntu fonts to the console as well. Steps 12–14 are blocked waiting for the Ubuntu Monospace to be released and available in the archive.

 11) gfxboot-theme-ubuntu (Proportional) - bug #732854
 12) Bterm (d-i) (Monospace) -
 13) Grub2 (Monospace) - bug #729470
 14) Console-setup (Monospace) - bug #724022

Tags: patch

Related branches

summary: - Feature Request: Provide an interface to modify console colors
+ Feature Request: Improve Console Colors
Changed in console-setup (Ubuntu):
assignee: nobody → Dustin Kirkland (kirkland)
Changed in kbd (Ubuntu):
assignee: nobody → Dustin Kirkland (kirkland)
Changed in console-setup (Ubuntu):
importance: Undecided → Wishlist
Changed in kbd (Ubuntu):
importance: Undecided → Wishlist
Changed in console-setup (Ubuntu):
status: New → In Progress
Changed in kbd (Ubuntu):
status: New → Triaged
Changed in newt (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
assignee: nobody → Dustin Kirkland (kirkland)
Changed in cdebconf (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
assignee: nobody → Dustin Kirkland (kirkland)
Changed in rootskel (Ubuntu):
assignee: nobody → Dustin Kirkland (kirkland)
importance: Undecided → Wishlist
status: New → Triaged
visibility: public → private
Changed in bogl (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
assignee: nobody → Dustin Kirkland (kirkland)
Changed in console-setup (Ubuntu):
status: In Progress → Triaged
Changed in kbd (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: Feature Request: Improve Console Colors

Adding a well tested, well formed kbd patch. This one should be suitable for upload to Natty.

description: updated
visibility: private → public
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kbd - 1.15-1ubuntu4

---------------
kbd (1.15-1ubuntu4) natty; urgency=low

  * src/setvtrgb.c, man/man8/setvtrgb.8, COPYING, debian/rules,
    debian/copyright: LP: #730672
    - Add a 'setvtrgb' utility to configure vt/console colors
    - add to udeb (so that this can improve installer usability)
    - add to /sbin, run by root
    - update copyright statement
 -- Dustin Kirkland <email address hidden> Tue, 08 Mar 2011 15:32:10 +0000

Changed in kbd (Ubuntu):
status: In Progress → Fix Released
tags: added: patch
Paul Sladen (sladen)
description: updated
Paul Sladen (sladen)
description: updated
Revision history for this message
Mario Limonciello (superm1) wrote :

Shouldn't this need an FFe?

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 730672] Re: Feature Request: Improve Console Colors

The font stuff is not intended for 11.04.

The color stuff is subject to UI Freeze.

description: updated
Paul Sladen (sladen)
description: updated
Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: Feature Request: Improve Console Colors

I have received the colors from Marcus:

1,222,57,255,0,118,44,225,128,255,0,255,0,255,0,255
1,56,181,199,111,38,181,225,128,0,255,255,0,0,255,255
1,43,74,6,184,113,233,225,128,0,0,0,255,255,255,255

Current screenshot attached.

Changed in console-setup (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Patch for the console-setup portion attached.

Changed in rootskel (Ubuntu):
status: Triaged → In Progress
Changed in bogl (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Dustin Kirkland  (kirkland) wrote :
Revision history for this message
Dustin Kirkland  (kirkland) wrote :
Revision history for this message
Dustin Kirkland  (kirkland) wrote :
Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 730672] Re: Feature Request: Improve Console Colors

Dustin, are there bright and dim versions? It's not clear from the
screenshot.

Revision history for this message
Launchpad Janitor (janitor) wrote : Re: Feature Request: Improve Console Colors

This bug was fixed in the package console-setup - 1.57ubuntu11

---------------
console-setup (1.57ubuntu11) natty; urgency=low

  * Address console-setup portion of LP: #730672, by installing
    the conffile and applying it at upstart
    - debian/vtrgb: Ubuntu's virtual terminal color scheme
    - debian/console-setup.setvtrgb.upstart: run setvtrgb during upstart
 -- Dustin Kirkland <email address hidden> Thu, 17 Mar 2011 17:10:50 -0500

Changed in console-setup (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rootskel - 1.93ubuntu3

---------------
rootskel (1.93ubuntu3) natty; urgency=low

  * src/lib/debian-installer.d/S30term: apply the configurable console
    colors in the d-i virtual terminals, LP: #730672
 -- Dustin Kirkland <email address hidden> Thu, 17 Mar 2011 13:34:43 -0500

Changed in rootskel (Ubuntu):
status: In Progress → Fix Released
summary: - Feature Request: Improve Console Colors
+ Improve Console Colors
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bogl - 0.1.18-4ubuntu1

---------------
bogl (0.1.18-4ubuntu1) natty; urgency=low

  * bterm.c:
    - update the hardcoded color map to the color palette selected by
      the Canonical Design Team, LP: #730672;
    - ideally, bterm.c would read these from the configuration file,
      /etc/vtrgb
 -- Dustin Kirkland <email address hidden> Thu, 17 Mar 2011 15:02:28 -0500

Changed in bogl (Ubuntu):
status: In Progress → Fix Released
Changed in newt (Ubuntu):
status: Triaged → In Progress
Changed in cdebconf (Ubuntu):
status: Triaged → Invalid
assignee: Dustin Kirkland (kirkland) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package newt - 0.52.11-2ubuntu3

---------------
newt (0.52.11-2ubuntu3) natty; urgency=low

  * debian/patches/800_ubuntu_skin.patch: LP: #730672
    - add an Ubuntu skin to newt colors, changing blue to magenta
    - note that 'magenta' is actually be aubergine, when coupled
      with the console-setup and kbd fixes for LP: #730672
 -- Dustin Kirkland <email address hidden> Thu, 17 Mar 2011 19:00:51 -0500

Changed in newt (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Closing the cdebconf task. No code is affected there. There is an alternate palette with high contrast colors for accessibility. But if that palette is not selected, the default newt one is.

description: updated
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Mark,

Yes, there are a total of 16 colors -- 8 normal ones, and 8 bright analogs. Marcus selected all 16 for us. The first 8 normal ones are new and distinct to Ubuntu. The latter 8 bright ones he and Ivanka felt that they couldn't improve upon the 8 pure ones, so we've left it at that.

Furthermore, Linux's vt driver supports all 16 (normal and bright) for foreground colors, but only the 8 normal ones for background colors. See:
 * http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html

The 256color.pl script that I used to create the screenshots wasn't the best way to show these. I found a better script in that x329.html document.

Here you go:
 * http://people.canonical.com/~kirkland/server-aubergine-cli-before.png
 * http://people.canonical.com/~kirkland/server-aubergine-cli-after.png

Dustin

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 730672] Re: Improve Console Colors

Lovely, thanks Dustin.

Any idea why we don't have colours in the default setup?

Revision history for this message
Martin Pool (mbp) wrote :

That's nice.

Are these also going to be the default gnome-terminal colors, or available as a palette there?

They look similar to what comes up under "Custom" but I don't know if that's just me.

Martin

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Martin, yes, the gnome-terminal palette (also selected by the Design
Team) inspired these which are used on the console. Thanks!

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

On Fri, Mar 18, 2011 at 2:57 AM, Mark Shuttleworth
<email address hidden> wrote:
> Any idea why we don't have colours in the default setup?

I'm wracking my brain against what you mean by this, and I'm not
seeing it... What "default setup" do you mean?

Dustin

Revision history for this message
In , Dustin (dustin-redhat-bugs) wrote :

Created attachment 486874
Make newt's system-wide palette configurable at run time

Hello,

We are carrying a small patch in Ubuntu that makes Newt's default color palette configurable, by optionally placing a configuration file at /etc/newt/palette.

If no file exists at that path, then newt's operation proceeds as normal.

If, on the other hand, a file does exist at that admin-owned location, a list of color values is read from that file and overloaded into the newtColors struct and set with newtSetColors().

I've tested it pretty well and seems to work quite nicely here.

For testing purposes, you can use these two sets of contents for your /etc/newt/palette values. The contents of the file is expected to contain newt's color keywords, all on a single line, comma-separate, no whitespace, and a total of 44 values. For example:

original:
white,blue,black,lightgray,black,lightgray,white,black,red,lightgray,lightgray,red,red,lightgray,lightgray,blue,lightgray,red,lightgray,blue,blue,lightgray,black,lightgray,lightgray,blue,black,lightgray,lightgray,red,white,blue,lightgray,blue,blue,red,blue,lightgray,black,lightgray,lightgray,red,black,brown

ubuntu:
white,magenta,black,lightgray,black,lightgray,white,black,red,lightgray,lightgray,red,red,lightgray,lightgray,magenta,lightgray,red,lightgray,magenta,magenta,lightgray,black,lightgray,lightgray,magenta,black,lightgray,lightgray,red,white,magenta,lightgray,magenta,magenta,red,magenta,lightgray,black,lightgray,lightgray,red,black,brown

Please consider committing this patch against your upstream newt branch. Thanks.

Signed-off-by:
Dustin Kirkland <email address hidden>

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I have submitted the patch to newt to make its system-wide palette configurable at run time, and attached that bug URL to this launchpad bug:
 * https://bugzilla.redhat.com/show_bug.cgi?id=689903

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I have also filed a bug with Debian, upstream for kbd, offering our setvtrgb tool, and linking to this bug report:
 * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=619299

Changed in kbd (Debian):
status: Unknown → New
Changed in cdebconf (Ubuntu):
status: Invalid → In Progress
assignee: nobody → Dustin Kirkland (kirkland)
Changed in cdebconf (Ubuntu Natty):
milestone: none → ubuntu-11.04-beta-2
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I had previously marked the cdebconf task 'invalid'. That was incorrect.

It took a while to shake out, but Colin recently rebuilt debian-installer, which pulled in a number of changes since the previous d-i build. In particular, the changes to newt that made this behavior configurable landed in the meantime. When d-i rebuilt against this newer version of newt, the aubergine newt palette dropped out of the installer.

I have a solution to this problem, which will in fact make this palette *totally* configurable for downstreams too. The changes will land in cdebconf. Attaching a patch here, for posterity. I'll look for the appropriate reviews and beta bug fix approvals ASAP.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Update cdebconf patch. Tested and working well with:
 * no FRONTEND_BACKGROUND value specified
 * FRONTEND_BACKGROUND=dark
 * FRONTEND_BACKGROUND=original
 * FRONTEND_BACKGROUND=ubuntu
 * FRONTEND_BACKGROUND=kubuntu
 * FRONTEND_BACKGROUND=xubuntu

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Note that this cdebconf upload requires release team approval. I have discussed this in IRC with Colin. He okay'd me to go ahead and upload now, and queue the upload for beta2. He will need to rebuild debian-installer to enable these changes before building Beta2 ISOs.

Changed in cdebconf (Ubuntu Natty):
importance: Wishlist → Medium
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Pushed cdebconf changes to bzr+ssh://bazaar.launchpad.net/~ubuntu-core-dev/cdebconf/ubuntu.

Uploaded cdebconf_0.154ubuntu2 to the Natty Beta2 queue.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cdebconf - 0.154ubuntu2

---------------
cdebconf (0.154ubuntu2) natty; urgency=low

  Fix for LP: #730672
  * src/modules/frontend/newt/newt.c:
    - use Ubuntu newt's new ability to read palette from configuration file
    - establish a symlink to /etc/newt/palette at initialization according
      to an optional FRONTEND_BACKGROUND kernel parameter
  * debian/palette*, debian/cdebconf-newt-udeb.install:
    - install palettes for [original, dark, ubuntu]
    - install a default /etc/newt/palette symlink to /etc/newt/palette.ubuntu
    - other derivatives can install their palette at /etc/newt/palette.FOO
      and set the FRONTEND_BACKGROUND=FOO kernel parameter
 -- Dustin Kirkland <email address hidden> Tue, 29 Mar 2011 12:22:21 -0500

Changed in cdebconf (Ubuntu Natty):
status: In Progress → Fix Released
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

FYI, the setvtrgb utility has been accepted and committed to the upstream kbd project \o/

 * http://git.altlinux.org/people/legion/packages/kbd.git?p=kbd.git;a=commitdiff;h=74221133a1810895623d903a00c60b3de4294655

So we should be able to drop the patches to kbd once upstream releases, Debian merges, and we sync with Debian again!

Cheers,
Dustin

Revision history for this message
In , Miroslav (miroslav-redhat-bugs) wrote :

Instead of requiring all 44 colors on one line I think it would be better to specify color of each item separately. For items which are not specified in the config the default would be used.

Something like:

root=white,black
border=,yellow

Few more things:
- the default path should be configurable in the configure script, /etc/newt/colors by default?
- perhaps it would be useful to be able to override the colors also via getenv("NEWT_COLORS"), e.g. NEWT_COLORS=root=white,black:border=,yellow

I can look into it if you want.

Thanks.

Revision history for this message
In , Dustin (dustin-redhat-bugs) wrote :

Awesome! Thanks for the response. I was worried this bug/patch might have gotten dumped into the bit bucket.

Regarding the format of the file, I just went for the simplest approach, from the perspective of reading the values in the C code. I didn't expect this to be something that people changed often, frequently, or on their own. I expected more that a distro or a packager would do this, and probably only ever do it once or twice, so I didn't really think about it in terms of a user-friendly interface, but instead, just as a "functional" one.

Regarding the default path, yes, of course, that could (and should?) very well be configurable. /etc/newt/colors seemed to me like a simple, straightforward, obvious default.

Regarding a "NEWT_COLORS" environment variable, that's an excellent idea, such that the color scheme could even be modified on an application-by-application, or process-by-process basis (rather than system wide).

I'm concerned a little bit by the complexity of the code necessary to process the descriptive configuration file and/or environment variable. At this point, I would prefer for you to point me to a git branch with your implementation of these, and I'll gladly build/test that, and port over Ubuntu's use of this functionality to your new implementation.

Cheers,
Dustin

Revision history for this message
In , Miroslav (miroslav-redhat-bugs) wrote :

Ok, I've pushed a patch implementing that to git (git://git.fedorahosted.org/git/newt), please let me know how it works for you.

Revision history for this message
In , Dustin (dustin-redhat-bugs) wrote :

Awesome, thanks! I'll get this tested...

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

How do the colours compare to the http://ethanschoonover.com/solarized ?

Are there goals to have these color pallete availablle via gnome-terminal, emacs, vim, dircolors, source-highlight, eclipse, gedit, etc..... ?

I'm currently using solarized and I truly love well designed colors across all of my monospace activities.

Revision history for this message
In , Miroslav (miroslav-redhat-bugs) wrote :

It is in newt-0.52.13.

Changed in kbd (Debian):
status: New → Fix Released
Changed in newt:
importance: Unknown → Undecided
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.