king vash
2008-03-08 03:52:47
I'm Finding the Interal Alter Cliff Colr (I call if RuneCliff Color)
I have 100 logged colors and i'm looking to refine my color finding loop
it has 3700 possible colors that will are acceptable. I think this is higher than it could be so i'm trying to improve it. is their a way to use Hue, Saturation and Luminance, to refine selectable colors more
I have 100 logged colors and i'm looking to refine my color finding loop
function FindRuneCliffColor: Integer; //Uses Tarajunky's basic autocolor format
var
GC, a, l, TColor, Red, Green, Blue : integer;
P:array of Tpoint;
begin
Flag;
GC := 4484727;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 45);
l:=GetArrayLength(P);
for a:= 0 to l-1 do
begin
if rs_OnMinimap(P[a].x,P[a].y) then
begin
TColor := GetColor(P[a].x,P[a].y);
if SimilarColors(TColor,GC,45) then
begin //add a bunch more check condition and debug this
ColortoRGB(TColor,Red,Green,Blue);
if ((Red >= 90) and (Red <= 150)) then
if ((Green >= 75) and (Green <= 140)) then
if ((Blue >= 40) and (Blue <= 90)) then
if ((Red >= Green) and (Green >= Blue)) then
if (((Red - Green) > 27) and ((Red - Blue) > 62)) then
if ((Green - Blue) > 56) then
if ((GetColor(P[a].x + 20, P[a].y ) = TColor) and (GetColor(P[a].x, P[a].y + 20) = TColor)) then
if ((GetColor(P[a].x + 15, P[a].y) = TColor) and (GetColor(P[a].x, P[a].y + 15) = TColor)) then
if ((GetColor(P[a].x + 10, P[a].y) = TColor) and (GetColor(P[a].x, P[a].y + 10) = TColor)) then
if ((GetColor(P[a].x + 20, P[a].y + 20) = TColor) and (GetColor(P[a].x + 10, P[a].y + 10) = TColor)) then
begin
Result := TColor;
WriteLn('RuneCliff Color = ' + IntToStr(TColor));
Exit;
end;
end;
end;
end;
Result := 0;
end;it has 3700 possible colors that will are acceptable. I think this is higher than it could be so i'm trying to improve it. is their a way to use Hue, Saturation and Luminance, to refine selectable colors more