U.S. trademark laws often do not allow generic drugs to look exactly like the brand drug. Generic drugs may differ from brand drugs in terms of color and flavor among other things, and the FDA looks to ensure that they do not affect the way the drug works. Note that the generic drug must have the same active ingredient(s) as the brand drug.
There is also a category of generics called Authorized Generics that are identical to the brand name drug in almost all aspects (e.g., size, shape, color, taste, smell, active and inactive ingredients).