在我的应用程序中,我使用 conio 库中的函数 textbackground() 。我有 16 种可用颜色:
#define BLACK 0
#define BLUE 1
#define GREEN 2
#define CYAN 3
#define RED 4
#define MAGENTA 5
#define BROWN 6
#define LIGHTGRAY 7
#define DARKGRAY 8
#define LIGHTBLUE 9
#define LIGHTGREEN 10
#define LIGHTCYAN 11
#define LIGHTRED 12
#define LIGHTMAGENTA 13
#define YELLOW 14
#define WHITE 15
如何将这些颜色转换为十六进制代码和 RGB,或者只是在哪里可以找到这些颜色的 RGB/十六进制代码(我有一个 int 2D 数组,其中单元格的值从 0 到 15,这些值代表像素颜色。现在我需要保存为 BMP 和 XPM2 格式)。