GetClosestColor

From SCAR Divi Manual
Revision as of 15:32, 2 July 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function GetClosestColor(Color: Integer; Colors: TIntegerArray): Integer; </source> ==Availability== SCAR Divi 3.21 > Current ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function GetClosestColor(Color: Integer; Colors: TIntegerArray): Integer;

Availability

SCAR Divi 3.21 > Current

Description

Calculates which color in a given TIntegerArray 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

See Also