Skip to contentSkip to conversation

color command

RFC Robert Millan 2 participants 3 messages Jul 25, 2007 – Jul 26, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I'd like to discuss the possibility of providing functionality equivalent to the "color" command in GRUB Legacy.

One of the downsides of how color worked in GRUB Legacy is that internally colors were handled by GRUB directly as VGA codes. Since this isn't portable, I suggest that we avoid it completely instead of just mapping them for platforms using non-VGA tables (I've seen that ofconsole is using RGB structs).

The solution I propose would be to have a "color" variable (and another one for highlight color?) with human readable names based on the list in GRUB Legacy, and let each terminal parse that and pull their colors during initialisation (this has the downside that one would have to reinitialise terminal after changing color, but this seems to be akin to the gfxterm / gfxmode situation and I think is reasonable).

Any comments? Should I go on implementing that?

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
#1 lore raw
Quoted 10 lines · Robert Millan

Hi,

I'd like to discuss the possibility of providing functionality equivalent to the "color" command in GRUB Legacy.

One of the downsides of how color worked in GRUB Legacy is that internally colors were handled by GRUB directly as VGA codes. Since this isn't portable, I suggest that we avoid it completely instead of just mapping them for platforms using non-VGA tables (I've seen that ofconsole is using RGB structs).

Quoted 9 lines

The solution I propose would be to have a "color" variable (and another one for highlight color?) with human readable names based on the list in GRUB Legacy, and let each terminal parse that and pull their colors during initialisation (this has the downside that one would have to reinitialise terminal after changing color, but this seems to be akin to the gfxterm / gfxmode situation and I think is reasonable).

Any comments? Should I go on implementing that?

Hi,

One idea was to define themable colors and then use grub_video_map_color to map this to hardware (color index or RGB value):

http://grub.enbug.org/VideoSubsystem#head-0df1ed220076ff6cc8188d1a192a21d443cc2456

You could define normal VGA color with like GRUB_COLOR_{WHITE|BLACK|LIGHT_GREEN|YELLOW...}. Then setup theme to map GRUB_COLOR_CONSOLE_BACKGROUND->GRUB_COLOR_BLACK and GRUB_COLOR_CONSOLE_FOREGROUND->GRUB_COLOR_LIGHT_GREEN. Of course we have this missing component 'theme support' here ;)

You can make dynamic variables in GRUB so that when you set it it will call function (which could call proper {term|theme}->set color function).

I would rather resolve this issue at same time when resolving graphical menu issues (meaning within graphical menu subproject) (still looking for more members ;)):

http://grub.enbug.org/Subprojects
http://grub.enbug.org/Subprojects/GraphicalMenu

Thanks,
Vesa Jääskeläinen

#2 lore raw
Quoted 6 lines · Vesa Jääskeläinen

Hi,

One idea was to define themable colors and then use grub_video_map_color to map this to hardware (color index or RGB value):

Quoted 7 lines

http://grub.enbug.org/VideoSubsystem#head-0df1ed220076ff6cc8188d1a192a21d443cc2456

You could define normal VGA color with like GRUB_COLOR_{WHITE|BLACK|LIGHT_GREEN|YELLOW...}. Then setup theme to map GRUB_COLOR_CONSOLE_BACKGROUND->GRUB_COLOR_BLACK and GRUB_COLOR_CONSOLE_FOREGROUND->GRUB_COLOR_LIGHT_GREEN. Of course we have this missing component 'theme support' here ;)

Ok, but you're missing the user interface part. How would that be glued?

Quoted 2 lines

You can make dynamic variables in GRUB so that when you set it it will call function (which could call proper {term|theme}->set color function).

Nifty. Is that some sort of preprocessor hack?

Quoted 6 lines

I would rather resolve this issue at same time when resolving graphical menu issues (meaning within graphical menu subproject) (still looking for more members ;)):

http://grub.enbug.org/Subprojects
http://grub.enbug.org/Subprojects/GraphicalMenu

Uhm that's inconvenient for us [1], because we need basic color functionality (i.e. similar to GRUB Legacy's) soon, and I can't really volunteer more time to speed up the graphical menu efforts.

[1] Debian, that is.

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.