Skip to content

Instantly share code, notes, and snippets.

@Swapnull
Last active February 22, 2016 11:16
Show Gist options
  • Save Swapnull/6e11a9f288b1896f005f to your computer and use it in GitHub Desktop.
Save Swapnull/6e11a9f288b1896f005f to your computer and use it in GitHub Desktop.
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