Sunday, 17 December 2017

New 'Display colours' .mnu file included in E2B v1.97

I have added a sample .mnu file, \_ISO\docs\Sample mnu Files\E2B Menus\Display_RGB_Colours.mnu, to E2B v1.97.

You can copy the Display_RGB_Colours.mnu file to a menu folder (e.g. \_ISO\UTILITIES) and use it to help you choose a grub4dos 4-bit or 24-bit RGB colour values...

Two new menu entries are added by the Display_RGB_Colours.mnu file.
Colour values are in the format of either an 8-bit number or a 64-bit number:

4-bit background + 4-bit text  (e.g. 0xF1 where F=white background and 1 = blue text)

4-bit colour in binary is 0xF = 1111 = IRGB (where I = intensity). Example: 0xE = 1110 = intensity+red+green = yellow


24-bit background + 24-bit text (e.g. 0x00FFFFFF00FF0000 where 00RRGGBB00RRGGBB = white background and red text). If the first 32-bit background number is omitted, then it will be 0 = black\transparent.

8-bit background/foreground colour selection
Using $[] sets the colour back to the previous standard setting.

24-bit colours
You can also use 24-bit colours to print console text, using the $[<colour value>] syntax, e.g.

echo $[0x00FFFF00]This prints yellow text on a black background

echo $[0x0077777700FF3300]This prints pinkish text (00FF3300) on a grey background (00777777)

Leading 0's after '0x' can be omitted, e.g. 0x000000F1 == 0xF1.

Note: Hex numbers that are 0xFF or smaller are treated as 2x4-bit colour values, so for example, for a 24-bit red value, do not use 0xFF (which is white text on white background) but use 0x1FF instead (which is red text with a very small hint of green + a black\transparent background).