kolibrios-fun/programs/cmm/lib/patterns/rgb.h
Kirill Lipatov (Leency) 034b012586 cmm: remove stand-alone downloader app, add lib/patterns/rgb.h
git-svn-id: svn://kolibrios.org@6020 a494cfbc-eb01-0410-851d-a64ba20cac60
2016-01-01 16:35:53 +00:00

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;
}