Added layout and color conversion functions