1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How to generate a palette in Angular Material 3 with a specific primary color

Discussão em 'Angular' iniciado por Andrei, Outubro 1, 2024.

  1. Andrei

    Andrei Guest

    I need to generate a palette in Angular Material 3 to implement a theme with a specific primary color. The buttons and some other controls should be this specific color. E.g. #C9007E. I'm following the official guide to generate the palette:

    > ng generate @angular/material:m3-theme
    ? What HEX color should be used to generate the M3 theme? It will represent your primary color palette. (ex. #ffffff) #C9007E
    ...


    Unfortunately, the generated palette doesn't contain the color I need. How can I generate the palette so that the primary color (as I understand hue 40 in the palette) will be the color that I need?

    // This file was generated by running 'ng generate @angular/material:m3-theme'.
    // Proceed with caution if making changes to this file.

    @use 'sass:map';
    @use '@angular/material' as mat;

    // Note: Color palettes are generated from primary: #C9007E
    $_palettes: (
    primary: (
    0: #000000,
    10: #3d0023,
    20: #63003c,
    25: #770049,
    30: #8c0056,
    35: #a10064,
    40: #b70072,
    50: #dd218d,
    60: #ff43a8,
    70: #ff82bb,
    80: #ffb0cf,
    90: #ffd8e5,
    95: #ffecf1,
    98: #fff8f8,
    99: #fffbff,
    100: #ffffff,
    ),
    ...

    Continue reading...

Compartilhe esta Página