ncurses的透明背景的控制台 [英] ncurses transparent console background

查看:280
本文介绍了ncurses的透明背景的控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的控制台,使透明度,当我运行其他应用程序的ncurses,我看到了后台保持透明。我试图让我的应用程序保持透明,而不是应用暗黑色不透明的背景。

My console has transparency enabled, when I run other ncurses apps, I see the the background stays transparent. I'm trying to make my app keep the transparency and not apply a dark black opaque background.

这是我在做什么,到目前为止

This is what I'm doing so far

start_color();
init_pair(1, COLOR_GREEN, COLOR_BLACK);

attron(COLOR_PAIR(1));
mvprintw(10,10, "Hello");

refresh();
attroff(COLOR_PAIR(1));

任何想法?

感谢

推荐答案

如果您的应用程序调用的 use_default_colors ,ncurses的(和的 NetBSD的诅咒)提供基于ECMA-48 SGR 39和49默认颜色的延伸。当你做到这一点,从明确着色单元,其前景和/或背景颜色相匹配,其对终端的颜色假设ncurses的叠句。

If your application calls use_default_colors, ncurses (and NetBSD curses) provide an extension based on ECMA-48 SGR 39 and 49 "default colors". When you do this, ncurses refrains from explicitly coloring cells whose foreground and/or background color match its assumption about the terminal colors.

有一个附加的功能 assume_default_colors 可用于改善默认颜色特征,其中所述终端使用白色背景上的黑色文本是(例如)。

There is an additional function assume_default_colors which can be used to improve the default-colors feature where the terminal is (for example) using black text on a white background.

大多数使用支持SGR 39/49 codeS颜色能力的终端,因此该功能可用于大部分的时间。

Most of the color-capable terminals you use support the SGR 39/49 codes, so the feature can be used most of the time.

延伸阅读:

  • Default Colors

这篇关于ncurses的透明背景的控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆