 sN, lN
   '         hN = hN + 1
   '         If (Abs(hN - hO) &lt; hErr) And (Abs(sN - sO) &lt; sErr) And (Abs(lN -
    lO) &lt; lErr) Then
   '            hErr = Abs(hN - hO)
   '            sErr = Abs(sN - sO)
   '            lErr = Abs(lN - lO)
   '            lMinIndex = i
   '         End If
   '      End If
   '   End With
   'Next i
   
   For i = 1 To m_iPalette
      With m_tPal(i)
         If (Red = .Red) And (Blue = .Blue) And (Green = .Green) Then
            ClosestIndex = i
            Exit P