From 901650f4a9b8d82ed92245f3f97073e577193b14 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 16 Jul 2026 21:56:29 +0000 Subject: [PATCH] feat: make NIP-05 and image hash-verify symbols follow the accent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The NIP-05 identifier colour and its verified badge were a fixed purple, and the image hash-verification "passed" seal was a fixed purple drawable — none followed the selected accent. Redefine the nip05 token to the theme primary (covering the identifier text, badge and the other nip05 call sites) and tint the nip_05 and original drawables with the accent at render. Also switch the hash-verification "failed" icon from a raw Color.Red to colorScheme.error, matching the themed error red used everywhere else. Removes the now-unused Nip05EmailColor light/dark constants. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01D1F9jXNwRGTP8qmsV3Wd69 --- .../amethyst/ui/components/ZoomableContentView.kt | 4 ++-- .../amethyst/ui/note/NIP05VerificationDisplay.kt | 3 +-- .../main/java/com/vitorpamplona/amethyst/ui/theme/Color.kt | 3 --- .../main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt | 3 ++- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt index 0e9f4eaba8..a499c08102 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt @@ -1254,7 +1254,7 @@ private fun HashVerificationSymbol(verifiedHash: Boolean) { painter = painterRes(R.drawable.original, 1), contentDescription = stringRes(id = R.string.hash_verification_passed), modifier = Size30Modifier, - tint = Color.Unspecified, + tint = MaterialTheme.colorScheme.primary, ) } } else { @@ -1268,7 +1268,7 @@ private fun HashVerificationSymbol(verifiedHash: Boolean) { symbol = MaterialSymbols.Report, contentDescription = stringRes(id = R.string.hash_verification_failed), modifier = Size30Modifier, - tint = Color.Red, + tint = MaterialTheme.colorScheme.error, ) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NIP05VerificationDisplay.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NIP05VerificationDisplay.kt index b87ed48c44..32730d9424 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NIP05VerificationDisplay.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NIP05VerificationDisplay.kt @@ -36,7 +36,6 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalUriHandler import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.style.TextOverflow @@ -481,7 +480,7 @@ fun RenderNIP05VerifiedSymbol( painter = painterRes(R.drawable.nip_05, compositionSizeReference), contentDescription = stringRes(id = R.string.nip05_verified), modifier = modifier, - tint = Color.Unspecified, + tint = MaterialTheme.colorScheme.nip05, ) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Color.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Color.kt index 047ea2941e..f432f5e73f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Color.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Color.kt @@ -48,9 +48,6 @@ val BitcoinLight = Color(0xFFB66605) val Following = Color(0xFF03DAC5) -val Nip05EmailColorDark = Color(0xFF765AA2) -val Nip05EmailColorLight = Color(0xFFa770f3) - val LightRedColor = Color(0xFFC62828) val RelayIconFilter = ColorFilter.colorMatrix(ColorMatrix().apply { setToSaturation(0.5f) }) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt index da98930d03..3bbf7ab42e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt @@ -546,8 +546,9 @@ val ColorScheme.mediumImportanceLink: Color val ColorScheme.placeholderText: Color get() = if (isLight) LightPlaceholderText else DarkPlaceholderText +// NIP-05 identifiers were a fixed purple; follow the selected accent instead. val ColorScheme.nip05: Color - get() = if (isLight) Nip05EmailColorLight else Nip05EmailColorDark + get() = primary val ColorScheme.onBackgroundColorFilter: ColorFilter get() = if (isLight) LightOnBackgroundColorFilter else DarkOnBackgroundColorFilter