Minor modifications for mac compatibility
Returns hex string considering alpha values