Checklists in the body, colour from tags, and commit-derived CalVer #4
@@ -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
|
* `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.
|
* Compose and therefore testable; `noteTintFor` supplies the real set.
|
||||||
*/
|
*/
|
||||||
fun resolvedNoteColor(id: String, color: String, known: Set<String>): String =
|
fun resolvedNoteColor(
|
||||||
|
id: String,
|
||||||
|
color: String,
|
||||||
|
known: Set<String>,
|
||||||
|
): String =
|
||||||
when {
|
when {
|
||||||
color.isNotEmpty() && color != "default" && color in known -> color
|
color.isNotEmpty() && color != "default" && color in known -> color
|
||||||
// A draft carries DRAFT_ID (""), so there is no identity to derive from yet.
|
// A draft carries DRAFT_ID (""), so there is no identity to derive from yet.
|
||||||
|
|||||||
@@ -185,5 +185,7 @@ fun noteTint(key: String): NoteTint = NOTE_TINTS[key] ?: NOTE_TINTS.getValue("de
|
|||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
@ReadOnlyComposable
|
@ReadOnlyComposable
|
||||||
fun noteTintFor(id: String, color: String): NoteTint =
|
fun noteTintFor(
|
||||||
noteTint(resolvedNoteColor(id, color, NOTE_TINTS.keys))
|
id: String,
|
||||||
|
color: String,
|
||||||
|
): NoteTint = noteTint(resolvedNoteColor(id, color, NOTE_TINTS.keys))
|
||||||
|
|||||||
Reference in New Issue
Block a user