¿Cómo puedo especificar un fondo transparente usando Perl y maldiciones?

StackOverflow https://stackoverflow.com/questions/3193941

  •  02-10-2019
  •  | 
  •  

Pregunta

Estoy intentando conseguir el fondo el color de terminales estándar en lugar de negro, pero me parece que no puede entenderlo. Cuando uso use_default_colors() las normas es como no usar colores, pero me gustaría cambiar el color de primer plano y no el color de fondo. Yo uso init_color_pair(1, COLOR_RED, COLOR_BLACK); pero eso me da un fondo negro, lo que no quiero.

¿Fue útil?

Solución

in order to have transparent background, the user of your app should have specified it in their .Xdefaults or something similar. If the user already has a transparent background, all you have to do, is to use the default background like so:

use Curses;
#...some init here...
# colors:
use_default_colors;  # mandatory, we want to use the default background which is transparent
init_pair 1, COLOR_BLUE, -1;  # -1 mandatory, again, we want *default* background
init_pair 2, -1, COLOR_WHITE;  # you can use the default foreground color if you like
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top