[pascal] r:= color and $ff;
g:= color shr 8 and $ff;
b:= color shr 16;
dec(r, DarkenBy);
dec(g, DarkenBy);
dec(b, DarkenBy);
if r<0 then r:= 0;
if g<0 then g:= 0;
if b<0 then b:= 0;
color:= r or (g shl or (b shl 16);[/pascal]
What Harray said only without function calls; r, g, b are integers
edit: wrote and instead of or