Looks like the color IDs being left out was a mistake. I fixed this in trunk r6237, stable r6239
In trunk 6238, I added two new functions to drawings.lua
draw.pack_cnf_colors(fg,bg) takes two colors in the system used by lua drawings (0-255 for native colors, 256-275 for chdk colors, or string names) and turns them into a number for use with set_config_value
draw.unpack_cnf_colors(v) takes a number returned by get_config_value and returns the foreground and background color as numbers in the script system.
Examples
require'drawings'
return draw.unpack_cnf_colors(get_config_value(require'gen/cnf_osd'.menu_color))
-- returns numbers like 258, 269
set_config_value(require'gen/cnf_osd'.menu_color,draw.pack_cnf_colors('green','magenta'))
set_config_value(require'gen/cnf_osd'.menu_color,draw.pack_cnf_colors(258,269))
I'm not really inclined to add new config values to set the color of the console separately from the menu color, but maybe I could be convinced
Many thanks for such a quick turn around.
As for being ‘convinced’ to include a way to separately control the console colours, I believe this would be a great enhancement in scripting.
Using colour to provide enhanced feedback is a powerful way to convey information. However, the current console is rather static in the that regard.
The optimum functionality would be away to control the colour of individual letters (fg,bg) in console text strings, however, I accept that may not be possible. For example creating a console text string to print, made up of substrings, each with their own colour states.
If the above is not possible, then a Lua command to control the colour of a line of console text would be a great additional feature to enhance the informational content, ie through colour.
The call could be print(“text”,[fg,[bg]])
IMHO ;-)