ng-matero / extensions

Angular Material Extensions Library.
https://ng-matero.github.io/extensions/
MIT License
388 stars 48 forks source link

(question) angular material theme palette #280

Closed AlonsoK28 closed 2 months ago

AlonsoK28 commented 2 months ago

hi budy.

you know if is possible to change angular material palette color from a service ?

ex. change primary color defined in a theme palette

$my-primary-palette: (
  50 : blue,
  100 : green,
  200 : #9fa8da,
  300 : #7986cb,
  400 : #5c6bc0,
  500 : #3f51b5,
  600 : #3949ab,
  700 : #303f9f,
  800 : #283593,
  900 : #1a237e,
  A100 : #8c9eff,
  A200 : #536dfe,
  A400 : #3d5afe,
  A700 : #a1fe30,
  contrast: (
    50 : #ffffff,
    100 : #000000,
    200 : #000000,
    300 : #ffffff,
    400 : #ffffff,
    500 : #ffffff,
    600 : #ffffff,
    700 : #ffffff,
    800 : #ffffff,
    900 : #ffffff,
    A100 : #000000,
    A200 : #ffffff,
    A400 : #ffffff,
    A700 : #000000,
  )
);

$my-primary: mat.define-palette($my-primary-palette, 50);
$my-accent: mat.define-palette($my-primary-palette, 100);
$my-accent: mat.define-palette($mat-blue, A100);
$my-warn: mat.define-palette(mat.$red-palette);

using a palette.service.ts

paletteService.updateprimaryColor(ffaa00)
nzbin commented 2 months ago

I'm sorry, it doesn't support.

AlonsoK28 commented 2 months ago

I'm sorry, it doesn't support.

Or its possible to define multiple different theme palettes and use/change it in the same project?

nzbin commented 2 months ago

I'm sorry, it doesn't support.

Or its possible to define multiple different theme palettes and use/change it in the same project?

I think you can ask Angular Material Team for help