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

namespace UtilsColor 配色方案工具集 更多...

函数

UI_EXP GColor HSVColor (float h, float s=1, float v=1, UINT alpha=255)
 
UI_EXP LPCTSTR ParseColor (LPCTSTR lpcolor, LPCTSTR end, GColor *out_color)
 
UI_EXP bool ParseStringToColor (const TCHAR *lpcolor, GColor *color)
 
UI_EXP BOOL ParseHSVColor (LPCTSTR lpcolor, float *h, float *s, float *v, float *alpha)
 
UI_EXP GColor Get24PhaseColor (int i)
 
UI_EXP void RGBToHSV (const GColor &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 (const GColor &c1, const GColor &c2)
 对比度
 

详细描述

namespace UtilsColor 配色方案工具集

函数说明

◆ ContrastRatio()

float UtilsColor::ContrastRatio ( const GColor c1,
const GColor c2 
)

对比度

◆ Get24PhaseColor()

UI_EXP GColor UtilsColor::Get24PhaseColor ( int  i)

◆ HSLToRGB()

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

◆ HSVColor()

UI_EXP GColor 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,
GColor out_color 
)

◆ 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,
GColor 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 ( const GColor 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]
鄂公网安备42018502007752 鄂ICP备2024082886
Copyright © 2025 · CBlueStudio 版权所有