On Mapping Gray Colors

Can anybody give me advice on way the following code doesn't give the
expected result?

Thanks in advance

Cristiano

{

  1) imageListMenu has several 256 color bitmaps created with Windoiws
PaintBush.
  2) I expect to change the 3D-gray colors to the ones currently in use.
  3) The transparent color is not changed because it will have the clBtnFace
anyway.

  the problems are:

  Sometime the clLime color of the bitmap comes out clBtnFace
  It doen't change clLime -> clWindows or clWhite, clLime -> clRed (or any
other color) will work.

Quote
}

procedure TMyForm.setColor();
  var
    i: integer;
    oOri: TBitMap;
begin

  for i:= 0 to imageListMenuNormal.Count - 1 do begin
    oOri:= TBitmap.Create();
    try
      oOri.Transparent:= true;
      oOri.PixelFormat:= pf8bit;   // CreateMappedBmp woks wuitj up to 256
colors bitmaps
      imageListMenuNormal.GetBitmap( i, oOri );
      oOri.Handle:= CreateMappedBmp( oOri.handle,
             [ clGray,      clSilver,       clOlive,   clLime   ],
             [ clBtnShadow, clBtnHighlight, clSilver,  clWindow ]);
      imageListMenuNormal.ReplaceMasked( i, oOri, clDefault);
    finally
      oOri.Free;
    end;
  end;

end;