As much as i agree with what has been said. This is actually your problem, not his. To an extent.
You need to be able to feel happy within yourself, you need to get your mind off feeling this sadness.. Maybe it is some sort of depression? I was depressed for a long time and this is kind of how i felt like. I wanted to reach out to anyone close to me to make me better again. Yet, they dont understand how you feel so cannot really help you at all. It is YOU that can get rid of this sadness. Fill your life with activities, friends, stay out of the same old routine you have going on and get out a little bit.
Can you imagine how frustrating for him this is? Your constant sadness, you needing him to hug you? It sounds childish. You need to be strong on your own and not feel so dependant on him for your happiness.
That being said, he is being cold for not wanting to make you feel better. The way he is handling it probably making things worse..Which may i add isnt his fault. How is he supposed to know these things? But i am sure if he was feeling down and wanted reassurance you would be happy to give it to him right? Point that out. BUT, he has probably had enough of you doing this if its all the time.
I think you need to apologise to him. STOP blaming him for your sadness because that in itself is very selfish and he knows it and probably resents you being like this. Explain how you feel, how you would feel better if he gave you a few reassuring hugs and nice words time to time and when you are feeling like this. And then vow you are going to put an end to your neediness and make big changes in order to help yourself.
If not for yourself, for your relationship also if it means alot to you.