It's interesting that you can't tell the difference between discrediting someone based on the colour of their skin vs. the (mental) capacity to lead. Of course there are those people who dislike Obama because they view him as an ineffective leader. I'd tend to agree with the view that Obama missed out on major opportunities to repair some of the damage in America's social fabric that was so evident in Va. last weekend, made serious foreign policy blunders, and left many campaign promises unchecked. None of that is because he's black. But I also know that there were large swathes of the political right who faulted him for his blackness.
Hillary lost because she's unlikable. After nearly three decades of Bushs and Clintons, Americans wanted change. I don't know why they thought Donald would be that change, but I do know that Democrats need a better message than 'have you seen the other guy?' if they hope to make any progress in 2018 and beyond.