fix(chat): tint composer send/stop/mic button with theme primary (#1410)

This commit is contained in:
m57 authored and GitHub committed 2026-09-30 14:33:08 +03:00
1 parent 0e39a71591
commit 3fb99f86ac
3 files changed
+44 -3

No files matched your search

@@ -2,6 +2,7 @@ package com.m57.hermescontrol.ui.chat.components
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.luminance
import com.m57.hermescontrol.theme.GlyphWhite
import com.m57.hermescontrol.theme.ThemePreset
import com.m57.hermescontrol.theme.resolveColorScheme
import org.junit.Assert.assertTrue
@@ -66,6 +67,20 @@ class ComposerPaletteTest {
}
}
@Test
fun actionButtonFollowsThePresetPrimaryWhenItIsLegible() {
forEveryPresetMode { mode, p, _ ->
val scheme = resolveColorScheme(ThemePreset.valueOf(mode.substringBefore(" ")), mode.endsWith("true"))
if (contrast(scheme.primary, p.card) >= 3f) {
assertTrue("$mode action must be primary", p.action == scheme.primary)
assertTrue(
"$mode glyph must be white or onPrimary",
p.onAction == scheme.onPrimary || p.onAction == GlyphWhite,
)
}
}
}
@Test
fun controlsAndCardEdgeStayVisibleInEveryPresetMode() {
forEveryPresetMode { mode, p, background ->