Skip to content

Update MaterialColor API docs to migrate to ColorScheme for Material3 apps #127228

Closed

Description

@seriann

Is there an existing issue for this?

Use case

I'm new to Flutter and I'm trying to configure a custom color scheme while respecting Material 3 color conventions. According to the Material 3 documentation, a tonal palette consists of thirteen tones, including white and black. A tone value of 100 represents maximum lightness and results in white. Each tone value between 0 and 100 expresses the amount of light present in the color.

I'm attempting to use the MaterialColor class to implement my custom colors, but it seems to be following the Material 2 convention instead.

I have referred to the Material 3 documentation (https://m3.material.io/styles/color/the-color-system/key-colors-tones#6bdb9471-b70d-42c9-8ace-76743c1fff13) and noticed that the color system and conventions described there differ from what I'm experiencing with the MaterialColor class.

Here are some screenshots illustrating the differences:

Material 3 Color Conventions:
image

MaterialColor class:
image
image

Material 2 Color Conventions:
https://m2.material.io/design/color/the-color-system.html#color-usage-and-palettes
image

Proposal

Maybe an update to that class to support new Material 3 colors conventions?

Activity

  1. added
    in triagePresently being triaged by the triage team
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on May 22, 2023
  2. changed the title [-]MaterialColor inconsistencies with Material 3?[/-] [+][Proposal] Make MaterialColor consistent with Material 3[/+] on May 22, 2023
  3. leighajarett commented on Jun 6, 2023

    @leighajarett
    Contributor

    Hi there! Thanks for filing this. Actually we have a new class specific to Material3 colors called ColorScheme - https://api.flutter.dev/flutter/material/ColorScheme-class.html. I'm adding an example to the MaterialColor API docs to make it clear that for Material 3 design you should use the ColorScheme class.

  4. changed the title [-][Proposal] Make MaterialColor consistent with Material 3[/-] [+]Update MaterialColor API docs to migrate to ColorScheme for Material3 apps[/+] on Jun 6, 2023
  5. github-actions commented on Jun 23, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions