On 09/24/2017 01:55 AM, Michael Van Canneyt wrote:
Then define
function Find_Color(anArray :PVGA256Array; r ,g ,b : Word) : Byte;
  Var
   Dist,closest:Double;
   i,bestchoice:Byte;

begin
    Closest:=200000;
    For i:= 0 to 255 do
       Begin
          Dist :=  ((R-AnArray^[i].R))*((R-AnArray^[i].R))
                     + ((G-AnArray^[i].G)*(G-Anarray^[i].G))
                     + ((B-AnArray^[i].B)*(B-AnArray^[i].B));
          If Dist<Closest Then
             Begin
                Closest:=Dist;
                BestChoice:=i;
             End;
       End;
    Find_VGA:=BestChoice;
end;


should that be Find_Color:=BestChoice; ??


--
 NOTE: No off-list assistance is given without prior approval.
       *Please keep mailing list traffic on the list unless*
       *a signed and pre-paid contract is in effect with us.*
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to