There is no masculine article or ending in this sentence.
Predicative adjectives (basically: those after the verb "to be") have no ending at all.
So you would say der Apfel ist rot, die Banane ist rot, das Fleisch ist rot, die Tomaten sind rot -- no matter what gender or number is in front of the ist, the adjective has no ending at all.
For those confused by the grammar terms: The predicate is a supplemental word. It [almost always?] comes after the noun. So in this example, because the word "red" supplements (comes after) the noun "the onion," red's ending doesn't change. [If I'm wrong, please correct me.]
If you talk about the colour as a property of an object directly you use the construction
X ist rot" (form of "sein"), literally "X is red"
If you explicitly talk about the colour (not the object itself) it is
"X hat die Farbe rot" (form of "haben"), literally "X has the colour red".
Though the second sentence would be very unusual, if not wrong, in English, the construction should be comprehensible.