Can I use only the sequence Esc[Value,Valuem
to set the brown color of background? (not only Black, Red, Green, Yellow, Blue, Magenta, Cyan, White... I want use more colors).
How to implement it easily? I want to implement it in my boot code, so I haven't the opportunity to use standard libraries.
Which parameters should I use?
ANSI defined only 8 colors. None are brown (though some people call the non-bright "yellow" a "brown", e.g., Yellow appears as brown in konsole).
If you want to use different colors in your Linux boot code, you could use the Linux console color palette escape sequence to alter one of the entries in the console's palette. Referring to console_codes(4) manual page:
ESC ] OSC (Should be: Operating system command) ESC ] P
nrrggbb: set palette, with parameter given in 7
hexadecimal digits after the final P :-(. Here n
is the color (0-15), and rrggbb indicates the
red/green/blue values (0-255). ESC ] R: reset
palette
Some people have written programs (or scripts) using this feature, e.g., setcolors - Change your Linux VT color palette (at boot time too!).
To alter colors in terminal emulators, e.g., after booting and logging into your desktop, these other terminals may have control sequences for setting entries in their color palettes.