import re
from System.Collections.Generic import *

def hueTunes(song,artist,album):

    palette=["red","green","purple","yellow","blue","white","pink","orange"]
    
    for colour in palette:
        #checks if song title has one of the colours in it. The 1st colour found generates event "Hue.song", w/ payloads {1}:colour, {2}:title
        if re.search(colour,song,re.I):
            vc.triggerEvent("Hue.song", List[str]([colour, song]))
            return
        #if no colour in song, checks if artist name has one of the colours in it. If so, generates event "Hue.song", w/ payloads {1}:colour, {2}:artist
        elif re.search(colour,artist,re.I):
            vc.triggerEvent("Hue.song", List[str]([colour, artist]))
            return
        elif re.search(colour,album,re.I):
            vc.triggerEvent("Hue.song", List[str]([colour, album]))#same thing, w/ album name. Put this above artist if you want it checked first.
            return            
