
procedure TForm2.Button2Click(Sender: TObject);

  function FindBlendPerc(Cl1, Cl2, Cl3: TColor; Tolerance: integer = 0): integer;
  var
    i: integer;
    c: TColor;
  begin
    Result := -1;
    if Tolerance = 0 then
    begin
      for i := 0 to 100 do
        if Blend(Cl1, Cl2, i) = Cl3 then
//        if Lighten(Cl1, i) = Cl3 then
        begin
          Result := i;
          Exit;
        end;
    end
    else
      for i := 0 to 100 do
      begin
//        c := Lighten(Cl1, i);
        c := Blend(Cl1, Cl2, i);
        if (Abs(GetRValue(c) - GetRValue(Cl3)) <= Tolerance) and
          (Abs(GetGValue(c) - GetGValue(Cl3)) <= Tolerance) and
          (Abs(GetBValue(c) - GetBValue(Cl3)) <= Tolerance) then
        begin
          Result := i;
          Exit;
        end;
      end;
  end;

var
  i, p: integer;
  cl1, cl2, cl3: TColor;
begin
  cl1 := StringToColor(InputBox('', 'Color 1:', 'clWhite'));
  cl2 := StringToColor(InputBox('', 'Color 2:', 'clWhite'));
  cl3 := StringToColor(InputBox('', 'Target Color:', '$00'));
  for i := 0 to 10 do
  begin
    p := FindBlendPerc(cl1, cl2, cl3, i);
    if p > -1 then
    begin
      ShowMessage('Percent: ' + IntToStr(p) + ' Tolerance: ' + Inttostr(i));
      Exit;
    end;
  end;
  ShowMessage('No match found!');
end;