SRL Archive - OSR Help

Figuring out tolerance


xdarkshadowx

2013-01-08 20:20:33

How do I figure out the tolerance between two colors? (I have the values for the colors, just wanna figure out the tolerance between them.)

Thanks :)

Gucci

2013-01-08 20:22:46

Use auto color aid

Kasi

2013-01-08 20:36:20


program new;

const
Col1 = 0;
Col2 = 16777215;

var
R1, G1, B1, R2, G2, B2, Tol : Integer;

begin
ColorToRGB(Col1, R1, G1, B1);
ColorToRGB(Col2, R2, G2, B2);

R1 := iAbs(R1 - R2);
G1 := iAbs(G1 - G2);
B1 := iAbs(B1 - B2);

Tol := MaxA([R1, G1, B1]);

Writeln(Tol);
end.

I think