finding which item in a list

Sort of hard to explain… I want this to work:

on changeLabel(theItem, theLabel)
	set theColors to {"orange", "red", "yellow", "blue", "purple", "green", "gray"}
	set theNum to item of theColors contains theLabel
	tell application "Finder" to set label index of alias (theItem as string) to theNum
end changeLabel

property theColors : {"orange", "red", "yellow", "blue", "purple", "green", "gray"}

on changeLabel(theItem, theLabel)
	repeat with labelIndex from 1 to count theColors
		if item labelIndex of theColors is theLabel then exit repeat
	end repeat
	tell application "Finder" to set label index of (theItem as alias) to labelIndex
end changeLabel