Added better fg/bg colour handling and hex palette function