Yes, it is. That's a rude form, when you have to "intensify" someone. Also, you should imagine "на х**" as a whole word/particle. The preposition "на" has nothing to do with its usual meaning in this context. By the way, you can use "одень-ка" in the sentence too: "Одень-ка ты на х** шапку..." (for more colours).
So, it is not "synecdoche", but I like your translation. In fact, that's a very good substitution.