lMinEB = lEB
                     lMinEG = lEG
                     lMinIndex = i
                  End If
               End If
            End With
         Next i
   
   End If
   
   ClosestIndex = lMinIndex
      
End Property

Public Sub Add(ByVal Red As Byte, ByVal Green As Byte, ByVal Blue As Byte)
    m_iPalette = m_iPalette + 1
    ReDim Preserve m_tPal(1 To m_iPalette) As RGBQUAD
    m_tPal(m_iPalette).rgbRed = Red
    m_tPal(m_iPalette).rgbGreen = Green
    m_tPal(m_iPalette).rgbBlue = Blue
End 