trigger colorblending ingame

I was searching a way to control the color correction.
With some help i figured this, I gues it’s a lot work around but thats my starting point:

( you need to have color correction on the cam and put this script on any object you may walk in, set the objects collider to trigger, you already knew for shure )

var count : boolean = false;
var dauer : float = 4;

var colorCorr : ColorCorrectionEffect;


function Start(){
 colorCorr = Camera.main.GetComponent(ColorCorrectionEffect);
}


function OnTriggerEnter(other:Collider) {
	count = true;
}



function Update () 
{
	if (count==true){
		if (dauer >= 0){
			Abziehen();
			}
			
		if (dauer <= 0){
			dauer = 0;
			}
		
		print (dauer);
	}

colorCorr.rampOffsetR = (dauer/ 4) * (-1) +1;		//normalize value to 0-1
}


function Abziehen () {
	
	dauer = dauer -1 * Time.deltaTime;
}

I gues there mus be a better way to do the timer. And i want to make more flexible so you will be able to choose the colors to blend in and the duration.