04_C++精灵库之color_map.h头文件源代码(2026年1月15日版)

#ifndef COLOR_MAP_H
#define COLOR_MAP_H

#include <unordered_map>
#include <string>
#include <tuple>
#include <vector>
#include <cstdint>

// 声明全局映射(extern 表示它会在某个 .cpp 文件中定义)
extern int colorStringCacheSize;     //颜色字符串缓存数量 
extern std::vector<std::string> colorStringCache;  //颜色字符串都放在这里了,共140个 
extern std::unordered_map<std::string, std::tuple<int, int, int>> colorNameToRGB;
extern std::unordered_map<std::string, std::string> basic_colors;


#endif // COLOR_MAP_H

关于李兴球

李兴球的博客是Python创意编程原创博客
此条目发表在C++分类目录。将固定链接加入收藏夹。

发表回复