Skip to content

Commit

Permalink
Fixed preferites in home songs #1174
Browse files Browse the repository at this point in the history
  • Loading branch information
fast4x committed Mar 23, 2024
1 parent efcd236 commit f862f5b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ fun dynamicColorPaletteOf(bitmap: Bitmap, isDark: Boolean, isPitchBlack: Boolean
val palette = Palette
.from(bitmap)
.maximumColorCount(8)
.addFilter(if (isDark) ({ _, hsl -> hsl[0] !in 36f..100f }) else null)
.addFilter(if (isDark || isPitchBlack) ({ _, hsl -> hsl[0] !in 36f..100f }) else null)
.generate()

val hsl = if (isDark) {
val hsl = if (isDark || isPitchBlack) {
palette.dominantSwatch ?: Palette
.from(bitmap)
.maximumColorCount(8)
Expand All @@ -155,7 +155,7 @@ fun dynamicColorPaletteOf(bitmap: Bitmap, isDark: Boolean, isPitchBlack: Boolean
}

fun dynamicColorPaletteOf(hsl: FloatArray, isDark: Boolean, isPitchBlack: Boolean): ColorPalette {
return colorPaletteOf(ColorPaletteName.Dynamic, if (isDark) ColorPaletteMode.Dark else ColorPaletteMode.Light, false).copy(
return colorPaletteOf(ColorPaletteName.Dynamic, if (isDark || isPitchBlack) ColorPaletteMode.Dark else ColorPaletteMode.Light, false).copy(


background0 = if (isPitchBlack) Color.hsl(hsl[0], hsl[1].coerceAtMost(0f), 0f)
Expand Down

0 comments on commit f862f5b

Please sign in to comment.