When I go to a funeral I wear a black or navy blue suit. I notice that others at the funeral are also wearing dark colors. Black conveys a sense of mourning or great sorrow. One would not want to wear a festive red dress or sports jacket to a funeral!
But I still don't get it. Does "at" mean "attending/taking part in?"
Basically, 'at' is the preposition of general location; it is replaced by 'in' when more precise indications of locality are needed. 'I was at Bill's funeral last week.' (I attended.) 'I drove my car 'in' the funeral procession. (I actively participated.)
'I saw Tom at the wedding.' 'Tom was not only at the wedding, he was an usher in the wedding party.'