All pastes #424304 Raw Edit

Someone

public text v1 · immutable
·published 2007-04-04 18:21 UTC
rendered paste body
program symbol;


function GetLadderColor(TheFloorColor:integer):integer;
var
  TmpBmp,MyX,MyY:integer;
  MyColor: integer;
  MyCanvas:tcanvas;
  TmpBool:boolean;
  MyH,MyS,MyL:extended;
begin
  TmpBmp:= BitmapFromString(100,90,'');
  MyCanvas:=GetBitmapCanvas(TmpBmp)

  CopyCanvas(GetClientCanvas,MyCanvas,598,39,698,129,0,0,100,90)
  for MyY:=0 to 99 do
  begin
   for MyX:=0 to 89 do
    begin
      MyColor:= MyCanvas.pixels[MyX,MyY];
      ColortoHSL(MyColor,MyH,MyS,MyL);
      if MyS  <40.0 then
      begin
        if MyL > 65.0 then
        begin
          if MyH<60.0 then
          begin
            if MyL<100.0then
            begin
              if MyH>0.0 then
              begin
                TmpBool:=true;
              end;
            end;
          end;
        end;
      end;
      if TmpBool then break;
    end;
    if TmpBool then break;
  end;
if TmpBool then result:=MyColor;
end;
var TheLadderColor,t:integer;
begin
t:=getsystemtime;
TheLadderColor:=GetLadderColor(FloorColor);
writeln(inttostr(TheLadderColor));
writeln(inttostr(getsystemtime-t)+'ms');
end.