Last active
December 3, 2016 07:10
-
-
Save 7m4mon/4acfc3bb883c8681577276a617016827 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function IndexOfColorArray(colorArray As Color(), pixelColor As Color) As Integer | |
Dim colorIndex As Integer = -1 | |
For i = 0 To colorArray.Length - 1 | |
If pixelColor.R = colorArray(i).R And | |
pixelColor.G = colorArray(i).G And | |
pixelColor.B = colorArray(i).B And | |
pixelColor.A = colorArray(i).A Then | |
colorIndex = i | |
Exit For | |
End If | |
Next | |
Return colorIndex | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment