I think this is what you want, will search for the number by hex (it uses some of wantonman's code)
program color;
Const
Color = ''; //Put the hex of the colour here between the ''
var
x, y, W, H :integer;
Function HexToColor(Hex : String) : integer;
Var
R, G, B : integer;
begin
Result := -1;
if(Length(Hex) <> 6)then
exit;
R := HexToInt(Copy(Hex, 1, 2));
G := HexToInt(Copy(Hex, 3, 2));
B := HexToInt(Copy(Hex, 5, 2));
Result := RGBtoColor(R, G, B);
end;
begin
GetClientDimensions(W, H);
findcolor(x, y, HexToColor(Color), 0, 0, W - 1, H - 1);
repeat
movemouse(x, y);
WriteLn('Clicking mouse at point: '+ToStr(Point(x, y)));
clickmouse(x, y, mouse_Left);
wait(20000); // this is the wait 20 seconds part adjust to your needs (time is in msec)
until(false);
end.