You don't need a custom palette but you will need a custom theme and variables to do this. Angular Material provides a sass function to extract colour from a theme but for that to happen the theme has to be a sass theme, you can't do it with the pre-compiled themes as they are in static css:
@import '~@angular/material/theming';
@include mat-core();
$app-primary: mat-palette($mat-indigo);
$app-accent : mat-palette($mat-pink, A200, A100, A400);
$app-warn : mat-palette($mat-red);
$app-theme: mat-light-theme($app-primary, $app-accent, $app-warn);
@include angular-material-theme($app-theme);
.custom-class {
color: mat-color($app-primary);
}
and in the HTML view:
<div class="custom-class">OK</div>
Edit: You can do it with a pre-built theme but you will have to go through a similar amount of steps as above. But the above leaves you with the flexibility of changing colours as you see fit.
https://material.angular.io/guide/theming-your-components