Gild The Lily

To “gild the lily” commonly means to overdue it. Putting a hat on a hat would be another way of saying this. The original phrase doesn’t seem to make much sense, though. Gilding is covering something in gold, and at first glance it seems it would be excessive to put gold on a flower. But this expression has actually been condensed from another, more flowery version.