Is this an fpspreadsheet question? The screenshot looks like that.
In fpspreadsheet the color of the selected cells is determined by this function from the color c of the cell:
function CalcSelectionColor(c: TColor; ADelta: Byte) : TColor;
type
TRGBA = record R,G,B,A: Byte end;
begin
c := ColorToRGB(c);
TRGBA(Result).A := 0;
if TRGBA(c).R < 128
then TRGBA(Result).R := TRGBA(c).R + ADelta
else TRGBA(Result).R := TRGBA(c).R - ADelta;
if TRGBA(c).G < 128
then TRGBA(Result).G := TRGBA(c).G + ADelta
else TRGBA(Result).G := TRGBA(c).G - ADelta;
if TRGBA(c).B < 128
then TRGBA(Result).B := TRGBA(c).B + ADelta
else TRGBA(Result).B := TRGBA(c).B - ADelta;
end;
This function adds ADelta to each dark color component (i.e. makes it brigher) and subtracts ADelta from a bright color component (i.e. makes it darker). ADelta should not be too large, definitely less than 128; in the worksheet grid the value is 16.