diff --git a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/DerivedTint.kt b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/DerivedTint.kt index 1ca4ede..78e9b33 100644 --- a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/DerivedTint.kt +++ b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/DerivedTint.kt @@ -81,7 +81,11 @@ fun derivedTint(id: String): String { * `known` is passed in rather than read from `NOTE_TINTS` so this file stays free of * Compose and therefore testable; `noteTintFor` supplies the real set. */ -fun resolvedNoteColor(id: String, color: String, known: Set): String = +fun resolvedNoteColor( + id: String, + color: String, + known: Set, +): String = when { color.isNotEmpty() && color != "default" && color in known -> color // A draft carries DRAFT_ID (""), so there is no identity to derive from yet. diff --git a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt index aef2744..971103f 100644 --- a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt +++ b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt @@ -185,5 +185,7 @@ fun noteTint(key: String): NoteTint = NOTE_TINTS[key] ?: NOTE_TINTS.getValue("de */ @Composable @ReadOnlyComposable -fun noteTintFor(id: String, color: String): NoteTint = - noteTint(resolvedNoteColor(id, color, NOTE_TINTS.keys)) +fun noteTintFor( + id: String, + color: String, +): NoteTint = noteTint(resolvedNoteColor(id, color, NOTE_TINTS.keys))