Home Design

by Androidhunt

Color theming on Android using the MDC library

Nick Rout
Image for post

Image for post

Image for post

Image for post

MDC color attributes with light baseline values
Image for post

Image for post

MDC color attributes with dark baseline values
Image for post

Image for post

Color attributes used by a button
app:backgroundTint=”?attr/colorSecondary”

Color tools

Image for post

Image for post

Material color tool (left) and Material palette generator (right)

Things to consider

Additional color slots

Image for post

Image for post

Material Design components responding to theme-level color overrides

Prefer attrs

Colors with alpha


#9937596D

Colors per state and theme overlays

Image for post

Image for post

Primary button (left) and secondary button (right)

API compatibility

val primary60 = AppCompatResources.getColorStateList(
context, R.color.primary60
)

Build a Material Theme

Image for post

Image for post

Changes in color values in Build a Material Theme

MDC developer docs

Image for post

Image for post

MDC button dev doc attribute table with default color values

Source code

Image for post

Image for post

MDC button default style with color values

Use MDC attrs in s and default styles

MaterialColors utility class

You may also like

Leave a Reply