I have a timer that uses $interval to count down from a number, to zero.
The goal is to take this timer, which is white - and slowly turn it red to give the user come sense of it's importance.
I'd love a better idea, but so far - what I've tried, is to use rgba(255, 255, 255, 1) and then $scope.x & rgba(255, {{x}}, {{x}}, 1) and drop x from 255 to 0, which would produce red.
In the browser console, I can see the inline style incrementing as I expected, however the styles aren't displaying on the element.
I've tried with just style="background-color: {{y}}" and ng-style="{ 'background-color': rgba(255, {{x}}, {{x}}, 1) }" but I'm not getting anything to appear on the front end.
In certain combinations the console shows a style="" and ng-style="" that contradict each other.

Please explain where I may be going astray - or if you recognize any edge cases that could lead to things working differently than expected.
UPDATE:
after some clarification from Sk. Tajbir and Diego, I'm no longer trying to use ngStyle -
Markup
<div
ng-if="ctrl.countdown >= 0"
class="time" rel="medium-up"
ng-hide="ctrl.selectedAnswer"
style="background-color: rgba(255, {{countDownColor}}, {{countDownColor}}, 1);">
<span>{{ctrl.countdown | secondsToDateTime | date:':ss'}}</span>
</div>
There are 2 versions of this because of a mobile break point - and it's parent relative container etc (this isn't the best option - but it is what is in place currently) --- the rel lets one be shown at a time. I took those out of the equation and nothing changed, so I don't think they play a part. There is the ngHide - but no idea how that could effect the color.
JS
...
$scope.countDownColor
ctrl.countdownTimer = $interval(function () {
if ( ctrl.countdown < 11 && ctrl.countdown > 0 ) {
$scope.countDownColor = 255 * (ctrl.countdown / 10);
} else if (ctrl.countdown === 0) {
ctrl.selectAnswer(ctrl.timesUpAnswer);
}
ctrl.countdown--;
}, 1000);
...
The countdown all works as expected on the front-end and the computed countDownColor shows in the console markup like this:
