hats have to be my favourite way of using up all those leftover bits of wool. you don't need a lot even if the hat is single- coloured (it's less effort to knit a surplus ball and a half into a hat than to take the one un-started ball back to the shop and try for a refund). but once you start knitting stripes or fair isle patterns, almost any short lengths of yarn can be used up.
because a hat is basically a rectangle of material, shaped at the top and joined up the back, there are none of the matching problems that occur with, for example, sweaters -even with a stripy sweater the back and front generally match, so while knitting one half you need to be sure there is enough yarn left to make the second. with a hat, you just start at the bottom and knit whatever you feel like - if it looks dreadfully wrong, it will always unwind.
Give it a try - find a simple hat pattern with straight sides and all the shaping on the crown - and see what you can create.