assert(colourToBytes(BGR555(9, 29, 31)) == [0xA9, 0x7F]); assert(colourToBytes(BGR565(9, 58, 31)) == [0x49, 0xFF]); assert(colourToBytes(RGB888(72, 232, 248)) == [72, 232, 248]);
See Implementation