Please don't let me catch any of you using Pixels again EVER :evil: . I'm making the assumption that you're using 24 bit color and your DestRect is clipped to screen size.
[pascal]procedure TConsole.FillRectDarken(Const DestRect: TRect; Const DarkenBy: Integer);
Var
desc: TDDSurfaceDesc;
Color: PByte;
val, i, j, NextLine: Integer;
Begin
FillChar(desc, SizeOf(desc), 0);
gmScreen.Surface.Lock(DestRect, desc);
Color:= PByte(desc.lpSurface);
NextLine:= desc.lPitch - 3 * (DestRect.Right - DestRect.Left + 1);
for j := DestRect.Top to DestRect.Bottom do
begin
for i := DestRect.Left to DestRect.Right do
begin
Val:= Color^;
dec(Val, DarkenBy);
if Val<0 then Val:= 0;
Color^:= Val;
inc(Color);

Val:= Color^;
dec(Val, DarkenBy);
if Val<0 then Val:= 0;
Color^:= Val;
inc(Color);

Val:= Color^;
dec(Val, DarkenBy);
if Val<0 then Val:= 0;
Color^:= Val;
inc(Color);
end;
inc(Color, NextLine);
end;
gmScreen.Surface.UnLock;
end;[/pascal]