Have a look at demo-app example https://github.com/angular/material2/tree/master/src/demo-app/progress-spinner
You need to bind to [color] property.
Then in your code you can keep the logic that will change the color dynamically as you need based on your percentage value. e.g:
Template:
<md-progress-spinner
class="number"
mode="determinate"
[value]="today?.MemorizationPercent"
[color]="getColor(today?.MemorizationPercent)">
</md-progress-spinner>
Function getColor()sample:
getColor(percentage) {
return percentage > 50 ? '_red_' : '_green_';
}
You need to define the colors in your custom material palette.
UPDATE:
important notice on your '_red_' and '_green_' colors:
The color of the progress-spinner. Can be primary, accent, or warn
As per progress-spinner source code https://github.com/angular/material2/blob/master/src/lib/progress-spinner/progress-spinner.ts#L110
/** The color of the progress-spinner. Can be primary, accent, or warn. */
@Input()
get color(): string { return this._color; }
set color(value: string) {
if (value) {
this._renderer.removeClass(this._elementRef.nativeElement, `mat-${this._color}`);
this._renderer.addClass(this._elementRef.nativeElement, `mat-${value}`);
this._color = value;
}
So getColor() becoming like say:
getColor(percentage) {
return percentage > 50 ? 'accent' : 'warn';
}
If you not happy with any colors from prebuild theme palettes than you have to create our own, see https://material.angular.io/guides for more details