Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for the help page of color #414

Open
JP95Git opened this issue Jun 11, 2023 · 2 comments
Open

Improvements for the help page of color #414

JP95Git opened this issue Jun 11, 2023 · 2 comments

Comments

@JP95Git
Copy link

JP95Git commented Jun 11, 2023

Hi,

while reading your source code, I noticed that the help page for "color" is incomplete.

help color (UEFI):
https://github.com/chenall/grub4dos/blob/efi/stage2/builtins.c#L2021

help color (normal, no UEFI):
https://github.com/chenall/grub4dos/blob/master/stage2/builtins.c#L3339

Based on the help page you should use
FG/BG. FG and BG are symbolic color names
for color definition in GRUB4DOS and
some hex numbers for GRUB4DOS (UEFI).

First some nice discovery: Both versions works in GRUB4DOS and GRUB4DOS (UEFI). Also both versions works in text mode and in graphics mode. Using the command "color" in the command line return the hex numbers for your currently selected color names, thanks for this nice help!

So these color definitions works for me every time:
color white/blue white/cyan
or
color normal=0x000000aa00ffffff highlight=0x0000aaaa00ffffff
or this nice mix of both worlds (great readability!)
color normal=white/blue highlight=white/cyan

First problem:
In text mode the border has the same colour as "normal". Once you switch to graphics mode the color of the border is a different color. You have to set it using color border=white/blue
or
color border=0x000000aa00ffffff
Perhaps we can append the border color as optional argument to this one
color NORMAL [HIGHLIGHT [HELPTEXT [HEADING ]]]
or use the normal color for the border in graphics mode too.

Second problem:
In the help page for UEFI the hex numbers should have the same length, as reported by the color command (no arguments). E.g. instead of 0x888800000000 you should write 0x0000888800000000.

Third problem:
The help page for UEFI does not explain the parts of the 64 bit number. This number actually holds foreground color and background color:
0x000000aa00ffffff

  • 0x000000aa = background color = blue
  • 0x00ffffff = foreground color = white

Fourth problem:
https://rmprepusb.com/tutorials/021-guide-to-grub4dos/

note that if in graphics hi-res mode, the background colour for normal text and help text will be ignored and will be set to transparent.

This should also be added to the help page for UEFI.

@yaya2007
Copy link
Collaborator

0.4.5c is an old version, not discussed here.
For compatibility, 4-bit color is reserved. 24 (32) bit color is recommended.

  1. Have been adjusted.
  2. adoption.
  3. add description.
  4. Add to.

@JP95Git
Copy link
Author

JP95Git commented Jun 18, 2023

Thanks. I am very bad in writing documentation so you better update the help page on your own.

yaya2007 added a commit that referenced this issue Jun 23, 2023
  碎片数由39增加到126。
  修正分区签名丢失。
  修正BOOTIA32.EFI启动时进不了菜单而重启。
  改进color函数帮助信息。issues #414
  避免分区项空洞。issues #416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants