Last active
February 22, 2016 11:16
-
-
Save Swapnull/6e11a9f288b1896f005f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class kinect(): | |
def __init__(self): | |
#initialize the class | |
self.foundColor = NULL | |
def getColor(self): | |
if self.searchForColor(255, 0, 0): #look for red | |
self.foundColor = 'red' | |
elif self.searchForColor(0, 255, 0): #look for green | |
self.foundColor = 'green' | |
elif self.searchForColor(0, 0, 255): #look for blue | |
self.foundColor = 'blue' | |
return self.foundColor | |
def searchForColor(self, red, green, blue): | |
#search for color with RGB values passed in | |
if found : | |
return true | |
else: | |
return false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment