forked from KolibriOS/kolibrios
2ec87d22f7
WebView 1.8b: - key scroll by up and down lists 12 pixels instead of 1 - open app with param when href="" contains '|' symbol, example: href="/sys/tmpdisk|a0" Eolite 3.96b: - fix sorting - an option to highlight odd lines - copy path to clipboard by clicking on path bar - rewrite the code related to device an folder update: so this change removed unnecessary refreshes - add refresh when /kolibrios mounted IconEdit 0.57b: - improve color gradient block - press Delete key when smth selected fill selection by color2 and resents selection - impove window appearance when the dark skin is set - fix a stupid but issue which made impossible to open non-square images - fix an issue that wrong zoom number displayed Notes 0.8: - reworking, work in progress - delete binary Sysmon 0.87: - minor visible improvement in progress bars TmpDisk 0.67a: - deny users to shoot in the foot: show forbid message on /tmp0 deletion git-svn-id: svn://kolibrios.org@7422 a494cfbc-eb01-0410-851d-a64ba20cac60
56 lines
998 B
C
56 lines
998 B
C
#ifndef INCLUDE_RGB_H
|
|
#define INCLUDE_RGB_H
|
|
|
|
:struct _rgb
|
|
{
|
|
byte b,g,r;
|
|
void DwordToRgb();
|
|
void SetRgb();
|
|
dword RgbToDword();
|
|
} rgb;
|
|
|
|
:void _rgb::DwordToRgb(dword _dword)
|
|
{
|
|
b = _dword & 0xFF; _dword >>= 8;
|
|
g = _dword & 0xFF; _dword >>= 8;
|
|
r = _dword & 0xFF; _dword >>= 8;
|
|
}
|
|
|
|
:void _rgb::SetRgb(dword _r, _g, _b)
|
|
{
|
|
r = _r;
|
|
g = _g;
|
|
b = _b;
|
|
}
|
|
|
|
:dword _rgb::RgbToDword()
|
|
{
|
|
dword _r, _g, _b;
|
|
_r = r << 16;
|
|
_g = g << 8;
|
|
_b = b;
|
|
return _r + _g + _b;
|
|
}
|
|
|
|
:dword MixColors(dword _base, _overlying, dword a)
|
|
{
|
|
_rgb rgb1, rgb2, rgb_final;
|
|
dword n_a;
|
|
if (a<0) || (a>255) {
|
|
debug("Wrong alpha param in MixColors()!");
|
|
debugval("alpha", a);
|
|
}
|
|
|
|
rgb1.DwordToRgb(_base);
|
|
rgb2.DwordToRgb(_overlying);
|
|
|
|
n_a = 255 - a;
|
|
|
|
rgb_final.b = calc(rgb1.b*a/255) + calc(rgb2.b*n_a/255);
|
|
rgb_final.g = calc(rgb1.g*a/255) + calc(rgb2.g*n_a/255);
|
|
rgb_final.r = calc(rgb1.r*a/255) + calc(rgb2.r*n_a/255);
|
|
|
|
return rgb_final.RgbToDword();
|
|
}
|
|
|
|
#endif |