Your query should be in a string format
query = "select distinct mydb.getprodsizecolor(idProduct,'%color%') as icolor from products"
So when you are assigning the value in a variable you can try it this way
desc = "'%color%'"
query = "select distinct mydb.getprodsizecolor(idProduct,"&desc&") as icolor from products"