Created
July 31, 2020 09:17
-
-
Save ricknout/c69e2b91b129fbc4228e361d69b0bc52 to your computer and use it in GitHub Desktop.
MDC-Android color utilities
This file contains hidden or 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
/* Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
// Resolve color from theme attr | |
val primaryColor = MaterialColors.getColor( | |
view, R.attr.colorPrimary | |
) | |
// Layer background color with overlay color + alpha | |
val overlayedColor = MaterialColors.layer( | |
view, R.attr.colorSurface, R.attr.colorPrimary, 0.38f | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment