You're not matching the quotes or #
character in the string. Change your pattern to:
preg_match_all('/\bcolor="([#a-f]*)"/i', $data, $mc);
But depending on what you're trying to parse, a regex might not be the best tool. If you're trying to parse HTML, it's always best to use an HTML parser.