fix(android): name the HSL thirds, give PlaceholderShape its own file, trim the cards file
release / web (push) Successful in 1m14s
release / go (push) Successful in 1m47s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m6s
release / android (push) Successful in 4m27s
release / Build signed APK (push) Successful in 4m52s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 16s
release / Verify release artifacts (tag releases only) (push) Skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-24 11:38:58 -05:00
co-authored by Claude Opus 5.5
parent d42a355612
commit ad7609e4c1
4 changed files with 14 additions and 9 deletions
@@ -137,14 +137,14 @@ private fun fromHsl(h: Double, s: Double, l: Double): Rgb {
return when { return when {
t < 1.0 / HUE_SECTORS -> p + (q - p) * HUE_SECTORS * t t < 1.0 / HUE_SECTORS -> p + (q - p) * HUE_SECTORS * t
t < HALF -> q t < HALF -> q
t < 2.0 / 3 -> p + (q - p) * (2.0 / 3 - t) * HUE_SECTORS t < TWO_THIRDS -> p + (q - p) * (TWO_THIRDS - t) * HUE_SECTORS
else -> p else -> p
} }
} }
return Rgb( return Rgb(
r = (channel(h + 1.0 / 3) * CHANNEL_MAX).roundToInt(), r = (channel(h + ONE_THIRD) * CHANNEL_MAX).roundToInt(),
g = (channel(h) * CHANNEL_MAX).roundToInt(), g = (channel(h) * CHANNEL_MAX).roundToInt(),
b = (channel(h - 1.0 / 3) * CHANNEL_MAX).roundToInt(), b = (channel(h - ONE_THIRD) * CHANNEL_MAX).roundToInt(),
) )
} }
@@ -156,5 +156,7 @@ private const val ROUND_TO = 5
private const val CHANNEL_MAX = 255.0 private const val CHANNEL_MAX = 255.0
private const val HUE_SECTORS = 6.0 private const val HUE_SECTORS = 6.0
private const val HALF = 0.5 private const val HALF = 0.5
private const val ONE_THIRD = 1.0 / 3
private const val TWO_THIRDS = 2.0 / 3
private const val MAX_WASH_SATURATION = 0.6 private const val MAX_WASH_SATURATION = 0.6
private const val MAX_WASH_LIGHTNESS = 0.3 private const val MAX_WASH_LIGHTNESS = 0.3
@@ -0,0 +1,4 @@
package com.fabledsword.minstrel.playlists.widgets
/** Which shelf a placeholder stands in for; it takes that shelf's tile shape. */
enum class PlaceholderShape { SQUARE, WIDE, ROUND }
@@ -40,9 +40,6 @@ import com.fabledsword.minstrel.theme.FabledSwordFlatTokens
* - seed-needed → songs-like slot with no seed artist liked yet * - seed-needed → songs-like slot with no seed artist liked yet
* - pending → never built / waiting for the next scheduled run * - pending → never built / waiting for the next scheduled run
*/ */
/** Which shelf a placeholder stands in for; it takes that shelf's tile shape. */
enum class PlaceholderShape { SQUARE, WIDE, ROUND }
@Composable @Composable
fun PlaylistPlaceholderCard( fun PlaylistPlaceholderCard(
label: String, label: String,
@@ -301,7 +301,11 @@ private fun rememberWash(url: String?): Color {
val dominant = rememberDominantColor(url) val dominant = rememberDominantColor(url)
if (dominant == Color.Transparent) return NeutralWash if (dominant == Color.Transparent) return NeutralWash
val toned = washTone( val toned = washTone(
Rgb(r = channel(dominant.red), g = channel(dominant.green), b = channel(dominant.blue)), Rgb(
r = (dominant.red * CHANNEL_MAX).roundToInt(),
g = (dominant.green * CHANNEL_MAX).roundToInt(),
b = (dominant.blue * CHANNEL_MAX).roundToInt(),
),
) )
return Color(red = toned.r, green = toned.g, blue = toned.b) return Color(red = toned.r, green = toned.g, blue = toned.b)
} }
@@ -315,8 +319,6 @@ private fun washBrush(wash: Color): Brush = Brush.horizontalGradient(
listOf(lerp(WashBase, wash, WASH_NEAR), lerp(WashBase, wash, WASH_FAR)), listOf(lerp(WashBase, wash, WASH_NEAR), lerp(WashBase, wash, WASH_FAR)),
) )
private fun channel(v: Float): Int = (v * CHANNEL_MAX).roundToInt()
private fun leadCoverUrl(playlist: PlaylistRef, covers: List<String>): String? = private fun leadCoverUrl(playlist: PlaylistRef, covers: List<String>): String? =
covers.firstOrNull()?.let(::albumCoverPath) ?: playlist.coverUrl.ifEmpty { null } covers.firstOrNull()?.let(::albumCoverPath) ?: playlist.coverUrl.ifEmpty { null }