Last active
March 21, 2021 01:07
-
-
Save jemshit/0e755f9a5669fe78d0e2 to your computer and use it in GitHub Desktop.
Android Text Colors according to Material Design Pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- Dark Text Color for Light Background --> | |
<color name="textDarkPrimary">#DE000000</color> <!--DE for %87 opacity--> | |
<color name="textDarkSecondary">#8A000000</color> <!--8A for %54 opacity--> | |
<color name="textDarkDisabled">#61000000</color> <!--61 for %38 opacity--> | |
<!-- White Text Color for Dark Background --> | |
<color name="textLightPrimary">#FFFFFF</color> <!--%100 opacity--> | |
<color name="textLightSecondary">#B2FFFFFF</color> <!--B2 for %70 opacity--> | |
<color name="textLightDisabled">#80FFFFFF</color> <!--80 for %50 opacity--> | |
<color name="textLightDisabledDEPRECATED">#4CFFFFFF</color> <!--4C for %30 opacity--> | |
</resources> | |
<!-- Material Design Pattern: https://www.google.com/design/spec/style/color.html#color-ui-color-application --> | |
<!-- by Jemshit Iskenderov: www.jemshit.com --> |
@eugenebrusov that file does not contain all material colors (try this) + text colors are not same with this gist. Just checked material doc again and only thing has changed is textLightDisabled
from 30% to 50%, so
<color name="textLightDisabled">#80FFFFFF</color>
@eugenebrusov that is awesome didn't know that existed. That being said I am have trouble locating those resources in my app. Do I need to include a special version of app compat/androidx?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is unnecessary. All the Material colors are already defined in the SDK in /values/colors_material.xml.