Checklists in the body, colour from tags, and commit-derived CalVer #4

Merged
bvandeusen merged 73 commits from dev into main 2026-08-29 13:39:45 -04:00
Showing only changes of commit 86f1e4a08f - Show all commits
@@ -261,15 +261,19 @@ private fun hslToArgb(
val sector = hue / HUE_SECTOR_DEGREES
val second = chroma * (1.0 - abs(sector % TWO - 1.0))
val match = lightness - chroma / TWO
val (red, green, blue) =
when (sector.toInt()) {
0 -> Triple(chroma, second, 0.0)
1 -> Triple(second, chroma, 0.0)
2 -> Triple(0.0, chroma, second)
3 -> Triple(0.0, second, chroma)
4 -> Triple(second, 0.0, chroma)
else -> Triple(chroma, 0.0, second)
}
// The six hue sectors, as a table rather than a `when` — which is also the form
// colors.ts uses, so the two read as the same function rather than as two people's
// idea of it. `sector` is in [0, 6) because the hue it came from is in [0, 360).
val ramps =
listOf(
Triple(chroma, second, 0.0),
Triple(second, chroma, 0.0),
Triple(0.0, chroma, second),
Triple(0.0, second, chroma),
Triple(second, 0.0, chroma),
Triple(chroma, 0.0, second),
)
val (red, green, blue) = ramps[sector.toInt()]
return (ALPHA_OPAQUE shl ALPHA_BIT_SHIFT) or
(channelByte(red + match) shl RED_BIT_SHIFT) or
(channelByte(green + match) shl GREEN_BIT_SHIFT) or