CBlueUI  
C++ 跨平台跨框架的数据可视化工具
载入中...
搜索中...
未找到
UtilsColor 命名空间参考

函数

UI_EXP COLORREF GrayColor (COLORREF color)
 彩色转换为灰度颜色
 
UI_EXP COLORREF HSVColor (float h, float s=1, float v=1, UINT alpha=255)
 
UI_EXP LPCTSTR ParseColor (LPCTSTR lpcolor, LPCTSTR end, COLORREF *out_color)
 
UI_EXP bool ParseStringToColor (const TCHAR *lpcolor, COLORREF *color)
 
UI_EXP bool ParseColorStyle (const TCHAR *lpcolor, COLORSTYLE *colors)
 
UI_EXP BOOL ParseHSVColor (LPCTSTR lpcolor, float *h, float *s, float *v, float *alpha)
 
UI_EXP COLORREF Get24PhaseColor (int i)
 
UI_EXP void RGBToHSV (COLORREF color, float *h, float *s, float *v)
 
UI_EXP void RGBToHSV (float r, float g, float b, float *h, float *s, float *v)
 RGBToHSV HSVToRGB相互转换
 
UI_EXP void HSVToRGB (float *r, float *g, float *b, float h, float s, float v)
 
UI_EXP void RGBToHSL (float r, float g, float b, float *h, float *s, float *l)
 RGBToHSL和HSLToRGB相互转换
 
UI_EXP void HSLToRGB (float *r, float *g, float *b, float h, float s, float l)
 
float Luminanace (uint8_t r, uint8_t g, uint8_t b)
 返回颜色明度值。算法取自国际标准。https://www.w3.org/TR/WCAG/#dfn-relative-luminance
 
float ContrastRatio (COLORREF c1, COLORREF c2)
 对比度
 
COLORSTYLE GetTextColorStyle (BOOL dark, int level)
 获得系统内置文本风格
 
COLORSTYLE GetColorStyle (int theme, int i)
 获得系统内置风格
 
void UpdateCustomThemeColors (int i, COLORSTYLE &colors)
 添加自定义主题配色方案
 
void ClearCustomThemeColors (int pos)
 清空
 
BOOL GetCustomThemeColors (int pos, COLORSTYLE &colors)
 获得自定义主题对应位置的颜色
 

函数说明

◆ ClearCustomThemeColors()

void UtilsColor::ClearCustomThemeColors ( int  pos)

清空

◆ ContrastRatio()

float UtilsColor::ContrastRatio ( COLORREF  c1,
COLORREF  c2 
)

对比度

◆ Get24PhaseColor()

UI_EXP COLORREF UtilsColor::Get24PhaseColor ( int  i)

◆ GetColorStyle()

COLORSTYLE UtilsColor::GetColorStyle ( int  theme,
int  i 
)

获得系统内置风格

参数
theme内置主题编号
i颜色类别,比如背景,前景
返回
COLORSTYLE

◆ GetCustomThemeColors()

BOOL UtilsColor::GetCustomThemeColors ( int  pos,
COLORSTYLE colors 
)

获得自定义主题对应位置的颜色

◆ GetTextColorStyle()

COLORSTYLE UtilsColor::GetTextColorStyle ( BOOL  dark,
int  level 
)

获得系统内置文本风格

参数
dark暗色还是亮色
level等级,一共四个等级
返回
COLORSTYLE

◆ GrayColor()

UI_EXP COLORREF UtilsColor::GrayColor ( COLORREF  color)

彩色转换为灰度颜色

◆ HSLToRGB()

UI_EXP void UtilsColor::HSLToRGB ( float *  r,
float *  g,
float *  b,
float  h,
float  s,
float  l 
)

◆ HSVColor()

UI_EXP COLORREF UtilsColor::HSVColor ( float  h,
float  s = 1,
float  v = 1,
UINT  alpha = 255 
)

◆ HSVToRGB()

UI_EXP void UtilsColor::HSVToRGB ( float *  r,
float *  g,
float *  b,
float  h,
float  s,
float  v 
)

◆ Luminanace()

float UtilsColor::Luminanace ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

返回颜色明度值。算法取自国际标准。https://www.w3.org/TR/WCAG/#dfn-relative-luminance

◆ ParseColor()

UI_EXP LPCTSTR UtilsColor::ParseColor ( LPCTSTR  lpcolor,
LPCTSTR  end,
COLORREF out_color 
)

◆ ParseColorStyle()

UI_EXP bool UtilsColor::ParseColorStyle ( const TCHAR lpcolor,
COLORSTYLE colors 
)

◆ ParseHSVColor()

UI_EXP BOOL UtilsColor::ParseHSVColor ( LPCTSTR  lpcolor,
float *  h,
float *  s,
float *  v,
float *  alpha 
)

◆ ParseStringToColor()

UI_EXP bool UtilsColor::ParseStringToColor ( const TCHAR lpcolor,
COLORREF color 
)

◆ RGBToHSL()

UI_EXP void UtilsColor::RGBToHSL ( float  r,
float  g,
float  b,
float *  h,
float *  s,
float *  l 
)

RGBToHSL和HSLToRGB相互转换

参数
r,g,b[0,1]
h: [0,360]
s:[0,1] 饱和度
l:[0,1]

◆ RGBToHSV() [1/2]

UI_EXP void UtilsColor::RGBToHSV ( COLORREF  color,
float *  h,
float *  s,
float *  v 
)

◆ RGBToHSV() [2/2]

UI_EXP void UtilsColor::RGBToHSV ( float  r,
float  g,
float  b,
float *  h,
float *  s,
float *  v 
)

RGBToHSV HSVToRGB相互转换

参数
r,g,b[0,1]
h: [0,360]
s:[0,1] 饱和度
v:[0,1]

◆ UpdateCustomThemeColors()

void UtilsColor::UpdateCustomThemeColors ( int  i,
COLORSTYLE colors 
)

添加自定义主题配色方案

鄂公网安备42018502007752 鄂ICP备2024082886
Copyright © 2025 · CBlueStudio 版权所有