Pergunta

printf "\033[1;32;40mGreen text on black background.\033[0m\n"

That is the green, but how can i get light green or other variation of color?

http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html , are only those color available for gnome-terminal as escape code?

Also how can i get bigger font with ruby?

Foi útil?

Solução

using the "1" as the first parameter, as you are doing already, that's as "light" a green as you're going to get. this guy's webpage might be helpful: http://www.linuxfocus.org/English/May2004/article335.shtml

testing on urxvt:

testing on urxvt not Gnome

[added later] there is a DEC extension for double-sized characters: Printing double-size characters with Ncurses but urxvt doesn't support it, I don't know about Gnome terminal.

Outras dicas

With an offset of 90 you can create bright/high contrast colors.

See here for a reference. Wikipedia mentions the bright color range, but doesn't really explain how to use them (if I haven't missed it).

If you combine it with the bold style you can create 4 variations of a color.

Example:

4 Shades of Blue

It's a matter of the terminal support. The ansi codes that you list are interpreted by the terminal emulator and those codes are the only available colours (it comes from the days before windows and when 16 colours caused a stir).

If you need more you could consider using a graphical interface to your ruby app such as tk.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top