Finds a value in the <ColorArray> and returns the index or -1 if the value is not found.
int32 Find( Color p_oColor, int32 p_nStartIndex )
Parameter Type | Parameter Name | Documentation |
---|---|---|
<Color> | p_oColor | A pointer to the <Color> object whose index you wish to find. |
int32 | p_nStartIndex | The index in the array at which to start the search. |
import library "type_color_array_util.ssl";
auto Color r = new Color( 255, 0, 0, 255 );
auto Color g = new Color( 0, 255, 0, 255 );
auto Color b = new Color( 0, 0, 255, 255 );
auto ColorArray data;
data.Add( r );
data.Add( g );
data.Add( b );
auto Color f = new Color( 0, 255, 0, 255 );
Console.Out( data.Find( f, 0 ) );
2 // Found matching item at index 2 in the array.