You don't have to wear black. You can wear navy, gray or any other dark color. Don't wear jeans, sneakers, pastels or anything sexy. Just remember that it's a funeral; you're there to pay your respect so it's not about fashion and it's not about you, KWIM?
If you have gray pants, you could wear them with a black top and black shoes. That's perfectly acceptable.
Sorry to be blunt, but I'm just being honest. I've had to go to a zillion funerals and I can't tell you how annoying it is to see people young people in short skirts, cleavage hanging out, ratty jeans, etc. It just seems so disrespectful to me.