Skip to content

Color: Document mapping from codes (e.g. a400) to names (e.g. accent1) #1000

Closed

Description

@phlippieb

Note: this is a duplicate of #987, which was closed without a satisfactory resolution.

It seems like material colors are usually named according to a code-based naming scheme (e.g. blue 500, orange a400). The material color library uses a different naming scheme (e.g. blue.base, orange.accent1). The alternative naming scheme is presumably chosen because blue.500 would be invalid syntax, and that's fine. But: how do these schemes map to one another?

As per @DanielDahan's suggestion on #987, I have checked out materialcolor.com. It does not resolve my issue, because it only has the proper Material color codes, not the special naming scheme used in the iOS library (e.g. lighten1, accent4, etc).

I would happily submit a PR to the iOS library that simply adds comments indicating the proper Material color code for each color, but I honestly don't know how the mapping works. If someone would be so kind as to explain it to me, I will submit a PR. I would just need the correct and complete version of this sort of table:

x.base => x500
x.lighten1 => x400
x.accent1 => xa100
etc

Activity

  1. changed the title [-]Color: Mapping from codes (e.g. a400) to names (e.g. accent1)[/-] [+]Color: Document mapping from codes (e.g. a400) to names (e.g. accent1)[/+] on Dec 20, 2017
  2. daniel-jonathan commented on Dec 22, 2017

    @daniel-jonathan
    Member

    Hey! Great point and thank you for submitting this. In Material 3, this will be addressed.

  3. phlippieb commented on Mar 15, 2018

    @phlippieb
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions