📄 color.h
字号:
#ifndef COLOR_H
#define COLOR_H
#include "stringfinder.h"
#include <vector>
#include <assert.h>
//====================================================================
struct ColorEntry
{
DWORD r,g,b,a;
DWORD compiled;
float fr,fg,fb;
float onebased_r,onebased_g,onebased_b,onebased_a;
ColorEntry():r(255),g(255),b(255),a(255)
,fr(1.0),fg(1.0),fb(1.0)
,onebased_r(1.0),onebased_g(1.0),onebased_b(1.0),onebased_a(1.0)
,compiled(0xFFFFFFFF){}
// fills missing fields from the r,g,b,a int components
void fill_missing();
};
//====================================================================
class ColorManager
{
public:
ColorManager(){ init(); }
void set(char* name, char* red, char* green, char* blue, char* alpha);
// see init() for valid indexes
ColorEntry* get(unsigned int index){ assert(index<list.size()); return &(list[index]); }
private:
StringFinder indexes;
std::vector<ColorEntry> list;
int insertpos;
void add(const char* name,int r, int g, int b, int a=255);
void init();
};
// Color Manager
extern ColorManager colorList;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -