SRL Archive - Help and Support

Auto-Sand Coloring?


pwnaz0r

2007-04-02 18:38:59

Heys guys. :p i havent been here in awhile and i only have a minute. Could someone please whip up and auto colorer for me or point me in the direction of a color converter that converts SCAR colors. I could make one but to b honest i dont have the time atm and i really need the right color converter. I would like the same as Tara's but if you decide to use HSL, etc, that would be great too :D

Boreas

2007-04-02 23:05:04

program ladder;

const
floorcolor=6776943;


function HowManyAround(HalfWidth,ParX,ParY,TheColor:integer;WhichCanvas:tcanvas):integer;
var MyX,MyY,MyColor,TmpResult:integer;
begin
for MyY:=ParY-(HalfWidth) to ParY+(HalfWidth) do
begin
for MyX:=ParX-(HalfWidth) to ParX+(HalfWidth) do
begin
MyColor:=WhichCanvas.pixels[MyX,MyY];
if MyColor=TheColor then
TmpResult:=TmpResult+1;
end;
end;
result:=TmpResult;
end;



function GetLadderColor(TheFloorColor:integer):integer;
var
TmpBmp,MyX,MyY:integer;
MyColor,TmpInt: integer;
MyCanvas:tcanvas;
TmpBool:boolean;

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];
if not(MyColor=78673)then
if ((MyColor/256) / 256) <20 then
begin
if ((MyColor/256) mod 256) <65 then
begin
if ((MyColor/256) mod 256) >15 then
begin
if (MyColor mod 256) < 105 then
begin
if (MyColor mod 256) > 60 then
begin
TmpInt:=HowManyAround(4,MyX,MyY,TheFloorColor,MyCanvas);
if TmpInt>30 then
begin
if TmpInt<100 then
TmpBool:=true;
end;

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.

In this case, I was looking for
R 60-105
G 15-65
B 0-20
if ((MyColor/256) / 256) <20 then
begin
if ((MyColor/256) mod 256) <65 then
begin
if ((MyColor/256) mod 256) >15 then
begin
if (MyColor mod 256) < 105 then
begin
if (MyColor mod 256) > 60 then

Get a whole bunch of samples (after logging out and in or after passing at least 1 loading screen) and convert them to RGB (you can figure out the conversion from above) and once you get the ranges, put it in something like that.

pwnaz0r

2007-04-03 00:08:09

o ok so i get the conversion from doing it manually? :( o well it would be a lot easier if there was like a function ;)

Boreas

2007-04-03 06:59:30

No, you do it in excel :p

uppit.com/283OY