$array = explode(",", $colors);
$search = implode("', '", $array); // implode instead of impode
$sql = "
SELECT
id,
name
FROM
colors
WHERE
name IN ('$search')
";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
//do something with the matches
}