Implemented the isTouchDevice and colorLuminace functions