1

In a new Android project, it provides a set of purple color for colorPrimary etc. I am interested in how the default color code is generated from.

Android default colors.xml

<resources>
    <color name="purple_200">#FFBB86FC</color>
    <color name="purple_500">#FF6200EE</color>
    <color name="purple_700">#FF3700B3</color>
    <color name="teal_200">#FF03DAC5</color>
    <color name="teal_700">#FF018786</color>
    <color name="black">#FF000000</color>
    <color name="white">#FFFFFFFF</color>
</resources>

On the other hand, I found a color tool in material.io that have provided

purple 200 = #ce93d8

purple 500 = #9c27b0

purple 700 = #7b1fa2

which does not match the android default purple color. Is it because it has used a different "purple"? or it changed the opacity?

Howard Lau
  • 163
  • 1
  • 11
  • One is `ARGB` and Other one is `RGB` hex code . A in `ARGB` represent alpha i.e opacity (first two chars). [here](https://stackoverflow.com/a/39128318/4168607) are opacity value check for yourself . – ADM Feb 16 '22 at 08:57
  • Both use 100% opacity, so it is not opacity. It is just that "purple" is not a well defined colour, and material prefer in general saturated colours (on the other hand, your purple_500 and purple_700 (on the code) seems not really purple (it seems they just selected one purple, and keep the hue angle, also if the result is no more purple) – Giacomo Catenazzi Feb 16 '22 at 08:57

0 Answers0