Black as your hat

Where does 'black as your hat' come from?

From the fact that for a hundred years or so the vast majority of men's hats in Britain - apart from straw hats which were a special case - were black. Think top hats, bowler hats, homburg hats, etc.