Konvert StyledResources

Co-authored-by: Alinson S. Xavier <git@axavier.org>
This commit is contained in:
olegivo
2020-08-13 07:40:49 -05:00
committed by Alinson S. Xavier
parent fd76a3c6fd
commit b0f5f96eee
3 changed files with 95 additions and 120 deletions

View File

@@ -9,7 +9,7 @@ object PaletteUtils {
@JvmStatic
fun colorToPaletteIndex(context: Context, color: Int): Int {
val palette = StyledResources(context).palette
val palette = StyledResources(context).getPalette()
return palette.indexOf(color)
}
@@ -43,7 +43,7 @@ object PaletteUtils {
@JvmStatic
fun getColor(context: Context, paletteColor: Int): Int {
val palette = StyledResources(context).palette
val palette = StyledResources(context).getPalette()
return if (paletteColor in palette.indices) {
palette[paletteColor]
} else {