Hi,
you can use this code: (maybe not the most elegant, but it works)
var rStart =0;
var gStart =0;
var bStart =0;
var r=0;
var g=0;
var b=0;
var modelItem;
var i=0;
$scope.colorChange = function() {
i++;
if (i<51){
r+=rStart/100;
g+=gStart/100;
b-=bStart/100;
$scope.app.view.Home.wdg[modelItem].color='rgb('+Math.round(r)+','+Math.round(g)+','+Math.round(b)+')';
}
else{
r-=rStart/100;
g-=gStart/100;
b+=bStart/100;
$scope.app.view.Home.wdg[modelItem].color='rgb('+Math.round(r)+','+Math.round(g)+','+Math.round(b)+')';
}
console.log($scope.app.view.Home.wdg[modelItem].color);
}
$scope.color = function(_r, _g, _b, _modelItem){
i=0;
rStart =_r;
gStart =_g;
bStart =_b;
r = _r;
g = _g;
b = _b;
modelItem = _modelItem;
$scope.intervalPromise = $interval($scope.colorChange, 10, 100);
}
This will flash the a modelItem in yellow buy calling the color function with the rgb values and name of the modelItem. For example color(100,100,100, "modelItem-1")