任何 Windows 终端的调色板都可以使用 pdcurses 进行编辑吗?
Can any Windows terminal's color palettes be edited with pdcurses?
我是ASCII美学的忠实粉丝,从终端创建图形的想法吸引了我。
我在Windows环境下玩pdcurses,我发现了一个非常有趣的属性:init_color。然而,它似乎根本不起作用!不仅是我尝试过的每个终端(CMD.exe, ConEmu和Console2)的颜色范围仅限于16种颜色,我似乎无法编辑调色板。
我在网上找不到关于这个话题的任何东西。
那么——这有可能吗?如果没有,还有其他选择吗?例如,我知道ConEmu有调色板,但我不知道如何告诉它在c++程序中使用哪个调色板。
下面是我尝试过的代码示例:
#include <curses.h>
int main()
{
init_color(1, 700, 600, 111);
initscr();
noecho();
if(has_colors() == FALSE)
{
endwin();
printf("Your terminal doesn't support color..!n");
return 1;
}
init_color(2, 555, 555, 222);
start_color();
init_pair(1, 1, 0);
init_pair(2, 2, 0);
attron(COLOR_PAIR(1));
printw("aaaa ");
attron(COLOR_PAIR(2));
init_color(12, 700, 600, 111);
printw("bbbbn");
getch();
endwin();
return 0;
}
在PDCurses 3.4中做这件事的代码曾经在某些版本的Windows中工作,但后来的Windows (XP Service Pack 3+)破坏了它。但是,如果你从git中获取最新的PDCurses代码,它已经被更新为可以与当前的Windows一起工作。
顺便说一句,你应该只在initscr()
之后调用init_color()
。
相关文章:
- 在createdialog创建的窗口中捕获用于编辑控件的OnMouseMove消息
- 编辑文件中的文本
- 有没有办法在远程设备上打开和编辑visual Studio 2017解决方案
- SetDlgItemInt 不会更改嵌入资源的编辑框
- 我无法在Visual Studio代码中使用CIN输入答案,它说输入您的年龄,但它说只读文本编辑器如何解决这个问题?
- C++,Qt:仅在双击后编辑qtablewidget项目
- 编辑字符串以包含括号 c++ 之间的变量
- Arduino函数无法编辑数组
- 调试符号中缺少 QObject 类信息(编辑但存在其他 Qt 类)
- "未定义对'WinMain@16'的引用"gcc 编辑器中的错误
- C++MFC编辑框处理双击
- 是否可以使用指针访问变量以避免直接编辑变量?
- 我的主窗口在创建时或单击更新区域时是否会收到编辑控件?
- 在 c++ 中编辑注册表项
- 无法将行编辑中的文本打印到 Qt C++ 中的标签
- 尝试使用 CMake 和 MinGW64 进行构建时出现多个编辑错误
- 如何从C++而不是虚幻编辑器中添加静态网格体组件的值?
- UE4 - Visual Studio在我从编辑器添加新的c ++文件后无法打开任何源文件 - UBT_COMPILED
- Qt如何将行编辑连接到进度条
- 任何 Windows 终端的调色板都可以使用 pdcurses 进行编辑吗?