Using Water's array
#include <array.au3>
#include <Color.au3>
Global $aValues = IniReadSection("C:temppantone.ini", "Section1")
_Arraysort($aValues, 0, 1, 0, 0)
;_ArrayDisplay($aValues)
$iColor = 16702209
$iGreen = _ColorGetGreen ( $iColor )
$iRed = _ColorGetRed ( $iColor )
$iBlue = _ColorGetBlue ( $iColor )
ConsoleWrite ( $iGreen & " " & $iRed & " " & $iBlue & @CRLF )
Dim $aDiff[1][2]
$iCounter = 0
For $i = 1 To UBound ( $aValues ) - 1
$iCurrentDiff = Abs ( _ColorGetGreen ( $aValues[$i][0] ) - $iGreen ) + Abs ( _ColorGetRed ( $aValues[$i][0] ) - $iRed ) + Abs ( _ColorGetBlue ( $aValues[$i][0] ) - $iBlue )
ReDim $aDiff[$iCounter+1][2]
$aDiff[$iCounter][0] = $iCurrentDiff
$aDiff[$iCounter][1] = $i
$iCounter += 1
Next
_ArraySort ( $aDiff, 0,0,0,0 )
$iLowestDiff = $aDiff[0][1]
ConsoleWrite ( "Value searched: " & $iColor & @CRLF & "Value returned: " & $aValues[$iLowestDiff][0] & @CRLF )