For example, if someone says "this tastes purple" instead of saying it tastes like grape, or if asked what flavor of Gatorade you prefer you answer with, "blue".
I don't think we have a term that refers specifically to substituting a color for a flavor and that's not related to synesthesia. It doesn't seem to be something that's common practice.
I think k1eran's answer of metonymy is the right one if the speaker is substituting purple for grape. Another possibility is that the speaker is using irony: since artificial grape flavor often doesn't taste like real grapes, using the color that's usually associated with the flavor is way to show that you know the flavor is "grape" but not truly grape.
In the latter example, though, "blue" is very nearly the actual name of a flavor — Cool Blue is the name of one Gatorade flavor:

As well, the speaker could be indicating a preference for all of the several Gatorade flavors that are colored blue.
Flavors often have a strong connection to specific colors, and vice versa. Processed foods like candy or sports drinks are often given colors that tell the consumer what flavor to expect, so describing a flavor in terms of its associated color isn't so strange. Conversely, we have lots of colors that are named for flavored things: orange, grape, cherry, lemonade, espresso, rosemary, cabernet, and mint are just a few words that can be either a flavor or a color.