Implement white balance function.