GetClosestColor
From SCAR Divi Manual
Definition
function GetClosestColor(Color: Integer; Colors: TIntArray): Integer;
Availability
SCAR Divi 3.21 > Current
- Values was a TIntegerArray before SCAR Divi 3.28.
Description
Calculates which color in a given TIntArray Colors is the most similar to the color given by Color using the current tolerance algorithm and returns it. The tolerance algorithm can be changed using ColorToleranceSpeed.
Example
begin WriteLn(GetClosestColor(100, [97, 98, 101])); end.
Output:
101