BIMHome v1.0.0
BIMHome接口文档说明
Public 成员函数 | Public 属性 | 所有成员列表
Color类 参考

表示颜色的类 更多...

#include <Color.h>

Public 成员函数

std::string asCSSString () const
 将颜色转换为 CSS 样式的字符串
 
std::string asHexString () const
 将颜色转换为十六进制字符串
 
template<typename T >
T asValue () const
 将颜色转换为模板类型
 
 Color (const Color &c)
 复制构造函数
 
 Color (float R=0.0, float G=0.0, float B=0.0, float A=0.0)
 构造颜色对象
 
 Color (uint32_t rgba)
 构造颜色对象
 
bool fromHexString (const std::string &hex)
 从十六进制字符串设置颜色
 
uint32_t getPackedValue () const
 获取颜色的打包值
 
bool operator!= (const Color &c) const
 比较两个颜色对象是否不相等
 
Coloroperator= (const Color &c)
 赋值运算符
 
bool operator== (const Color &c) const
 比较两个颜色对象是否相等
 
void set (float R, float G, float B, float A=0.0)
 设置颜色分量
 
ColorsetPackedValue (uint32_t rgba)
 设置颜色值
 
void setValue (const Color &q)
 Color 类型设置颜色值
 
template<typename T >
void setValue (const T &q)
 从模板类型设置颜色值
 

Public 属性

float a
 
float b
 
float g
 
float r
 颜色值,公共可访问
 

详细描述

表示颜色的类

提供颜色的表示和操作,支持多种颜色格式,包括 RGB、RGBA 和十六进制表示。


该类的文档由以下文件生成: