forked from KolibriOS/kolibrios
034b012586
git-svn-id: svn://kolibrios.org@6020 a494cfbc-eb01-0410-851d-a64ba20cac60
23 lines
336 B
C
23 lines
336 B
C
|
|
struct _rgb
|
|
{
|
|
byte r,g,b;
|
|
void DwordToRgb();
|
|
dword RgbToDword();
|
|
} rgb;
|
|
|
|
void _rgb::DwordToRgb(dword _dword)
|
|
{
|
|
r = _dword & 0xFF; _dword >>= 8;
|
|
g = _dword & 0xFF; _dword >>= 8;
|
|
b = _dword & 0xFF; _dword >>= 8;
|
|
}
|
|
|
|
dword _rgb::RgbToDword()
|
|
{
|
|
dword _b, _g;
|
|
_b = b << 16;
|
|
_g = g << 8;
|
|
return _b + _g + r;
|
|
}
|