SRL Archive - OSR Help

CTS3 Help


YoHoJo

2011-12-20 22:19:20


Program CTS3;
{.include SRL\SRL.scar}
{.Include SRL\SRL\Misc\Debug.SCAR}
Procedure ReturnValues(colors: TIntegerArray; var HueMods, SatMods: Extended; var color, Tolerance: Integer);
Var
h, s, t: Extended;
I,II : integer;
HSLColor : Array[1..3] of Extended;
HSL : Array[0..1] of Array[1..3] of Extended;
begin;
For I:= 1 to 3 do
begin;
HSL[0][i] := 255;
end;

For I:= 0 to High(Colors) do
begin;
ColortoHSL(Colors[i],HSLColor[1],HSLColor[2],HSLColor[3]);
For II:= 1 to 3 do
begin;
HSL[0][II] := MinE(HSLColor[II],HSL[0][II]);
HSL[1][II] := MaxE(HSLColor[II],HSL[1][II]);
end;
end;

H := (HSL[1][1] - HSL[0][1]);
S := (HSL[1][2] - HSL[0][2]);
T := (HSL[1][3] - HSL[0][3]);

try
HueMods := (H/T);
SatMods := (S/T);
Tolerance := Round(t);
except
HueMods := 0;
SatMods := 0;
Tolerance := Round(0.0);
end;

Color := HSLToColor((HSL[1][1] + HSL[0][1]) div 2,(HSL[1][2] + HSL[0][2]) div 2,(HSL[1][3] + HSL[0][3]) div 2);
end;


Procedure DoitBro;
var
HMod, SMod:Extended;
Col, Tol: Integer;
TPA:TPointArray;
Begin
ReturnValues([2322763, 2455375, 2720856, 2388812, 2521938], Hmod, Smod, Col, Tol);

ColorToleranceSpeed(3); //CTS3
SetColorSpeed2Modifiers(Hmod, SMod);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Col, MSX1, MSY1, MSX2, MSY2, Tol);
DebugTPA(TPA,'');



End;



Begin
DoitBro;
End.

Is that all good?
Make sense?
Should work?

mormonman

2011-12-20 22:35:07

CTS3 != Hue Saturation Luminence

It's CIELab.

YoHoJo

2011-12-20 22:41:45

idk mayne, that's just some code Flight gave me :/
I wish ACA would update and add CTS3 to it, so easy!
How do I get info for CTS3?

mormonman

2011-12-20 22:46:21

Flight -.-

When a new simba get released we will actually be able to make scripts like this.

YoHoJo

2011-12-20 22:51:01

HEY!
Flight is really cool and my friend, don't be a bully!

Flight

2011-12-20 23:20:48

From: mormonman
Flight -.-


And what's that supposed to mean?

mormonman

2011-12-20 23:34:46

Ahh you couldn't see my facial expression. It was like: "Oh silly Flight" ;)

mormonman

2011-12-21 00:26:34

https://github.com/MerlijnWajer/Simba/commit/1b88459a5396e8dec0d7966373d1312c32ddd9b4
You could also build the most recent simba(after this commit) and get a headstart.