fixed crash bug

Change-Id: I0bb2b2ff15e6fc14b25658b2db47c751a93dd2f7
z-order now sorts by actual color data instead of rgb values

Change-Id: I7ffe76c8d34cbfe1a23a5f42789a61177c26efc7