implemented applyColorMapping func