soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SColor Class Reference

以ARGB格式存储颜色值的类 More...

#include <SColor.h>

Public Member Functions

 SColor (BYTE r, BYTE g, BYTE b, BYTE a=0xFF)
 构造函数,使用RGB和Alpha值初始化颜色
 
 SColor (COLORREF cr, BYTE alpha)
 构造函数,使用COLORREF和Alpha值初始化颜色
 
 SColor (COLORREF cr)
 构造函数,使用COLORREF初始化颜色
 
const COLORREF toCOLORREF () const
 将颜色转换为COLORREF格式
 
const DWORD toARGB () const
 将颜色转换为DWORD格式(ARGB)
 
void setRGB (COLORREF cr)
 设置颜色的RGB值
 
void setRGB (COLORREF cr, BYTE alpha)
 设置颜色的RGB值和Alpha值
 
void updateAlpha (BYTE alpha)
 更新颜色的Alpha值
 

Public Attributes

DWORD b: 8
 蓝色分量(0-255)
 
DWORD g: 8
 绿色分量(0-255)
 
DWORD r: 8
 红色分量(0-255)
 
DWORD a: 8
 透明度分量(0-255)
 

Detailed Description

以ARGB格式存储颜色值的类

Definition at line 24 of file SColor.h.

Constructor & Destructor Documentation

◆ SColor() [1/3]

SColor::SColor ( BYTE r,
BYTE g,
BYTE b,
BYTE a = 0xFF )
inline

构造函数,使用RGB和Alpha值初始化颜色

Parameters
r红色分量(0-255)
g绿色分量(0-255)
b蓝色分量(0-255)
a透明度分量(0-255,默认为255)

Definition at line 33 of file SColor.h.

◆ SColor() [2/3]

SColor::SColor ( COLORREF cr,
BYTE alpha )
inline

构造函数,使用COLORREF和Alpha值初始化颜色

Parameters
crCOLORREF颜色值
alpha透明度分量(0-255)

Definition at line 46 of file SColor.h.

◆ SColor() [3/3]

SColor::SColor ( COLORREF cr)
inline

构造函数,使用COLORREF初始化颜色

Parameters
crCOLORREF颜色值

Definition at line 59 of file SColor.h.

Member Function Documentation

◆ setRGB() [1/2]

void SColor::setRGB ( COLORREF cr)
inline

设置颜色的RGB值

Parameters
crCOLORREF颜色值

Definition at line 91 of file SColor.h.

◆ setRGB() [2/2]

void SColor::setRGB ( COLORREF cr,
BYTE alpha )
inline

设置颜色的RGB值和Alpha值

Parameters
crCOLORREF颜色值
alpha透明度分量(0-255)

Definition at line 104 of file SColor.h.

◆ toARGB()

const DWORD SColor::toARGB ( ) const
inline

将颜色转换为DWORD格式(ARGB)

Returns
DWORD格式的颜色值

Definition at line 80 of file SColor.h.

◆ toCOLORREF()

const COLORREF SColor::toCOLORREF ( ) const
inline

将颜色转换为COLORREF格式

Returns
COLORREF颜色值

Definition at line 71 of file SColor.h.

◆ updateAlpha()

void SColor::updateAlpha ( BYTE alpha)
inline

更新颜色的Alpha值

Parameters
alpha透明度分量(0-255)

Definition at line 117 of file SColor.h.

Member Data Documentation

◆ a

DWORD SColor::a

透明度分量(0-255)

Definition at line 131 of file SColor.h.

◆ b

DWORD SColor::b

蓝色分量(0-255)

Definition at line 128 of file SColor.h.

◆ g

DWORD SColor::g

绿色分量(0-255)

Definition at line 129 of file SColor.h.

◆ r

DWORD SColor::r

红色分量(0-255)

Definition at line 130 of file SColor.h.


The documentation for this class was generated from the following file: