From 6f61248fc3f8971479da0eb77f2efefcdf9fa79e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Saleniuk?= <30429749+saleniuk@users.noreply.github.com> Date: Fri, 9 Feb 2024 17:58:20 +0100 Subject: [PATCH] fix: text highlight colors [WPB-5940] (#2680) --- .../conversations/search/HighLightName.kt | 5 ++- .../search/HighLightSubtTitle.kt | 3 +- .../android/ui/markdown/MarkdownComposer.kt | 3 +- .../wire/android/ui/theme/WireColorPalette.kt | 40 +++++++++---------- .../wire/android/ui/theme/WireColorScheme.kt | 22 +++++----- 5 files changed, 39 insertions(+), 34 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/search/HighLightName.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/search/HighLightName.kt index 3602912f96..48dc570607 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/search/HighLightName.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/search/HighLightName.kt @@ -65,7 +65,10 @@ fun HighlightName( .forEach { highLightIndex -> if (highLightIndex.endIndex <= this.length) { addStyle( - style = SpanStyle(background = MaterialTheme.wireColorScheme.highLight.copy(alpha = 0.5f)), + style = SpanStyle( + background = MaterialTheme.wireColorScheme.highlight, + color = MaterialTheme.wireColorScheme.onHighlight, + ), start = highLightIndex.startIndex, end = highLightIndex.endIndex ) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/search/HighLightSubtTitle.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/search/HighLightSubtTitle.kt index 35cb6c0e54..21edf700ff 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/search/HighLightSubtTitle.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/search/HighLightSubtTitle.kt @@ -67,7 +67,8 @@ fun HighlightSubtitle( if (highLightIndex.endIndex <= this.length) { addStyle( style = SpanStyle( - background = MaterialTheme.wireColorScheme.highLight.copy(alpha = 0.5f), + background = MaterialTheme.wireColorScheme.highlight, + color = MaterialTheme.wireColorScheme.onHighlight, ), start = highLightIndex.startIndex + suffix.length, end = highLightIndex.endIndex + suffix.length diff --git a/app/src/main/kotlin/com/wire/android/ui/markdown/MarkdownComposer.kt b/app/src/main/kotlin/com/wire/android/ui/markdown/MarkdownComposer.kt index ee5dd8aa6b..c025fd247e 100644 --- a/app/src/main/kotlin/com/wire/android/ui/markdown/MarkdownComposer.kt +++ b/app/src/main/kotlin/com/wire/android/ui/markdown/MarkdownComposer.kt @@ -306,7 +306,8 @@ fun appendLinksAndMentions( if (highLightIndex.endIndex <= length) { addStyle( style = SpanStyle( - background = nodeData.colorScheme.highLight.copy(alpha = 0.5f), + background = nodeData.colorScheme.highlight, + color = nodeData.colorScheme.onHighlight, fontFamily = nodeData.typography.body02.fontFamily, fontWeight = FontWeight.Bold ), diff --git a/app/src/main/kotlin/com/wire/android/ui/theme/WireColorPalette.kt b/app/src/main/kotlin/com/wire/android/ui/theme/WireColorPalette.kt index e34148bb19..4fb5a1af31 100644 --- a/app/src/main/kotlin/com/wire/android/ui/theme/WireColorPalette.kt +++ b/app/src/main/kotlin/com/wire/android/ui/theme/WireColorPalette.kt @@ -134,25 +134,25 @@ object WireColorPalette { val LightRed900 = Color(0xFF3A0006) @Stable - val LightYellow50 = Color(0xFFF3F0ED) + val LightAmber50 = Color(0xFFF3F0ED) @Stable - val LightYellow100 = Color(0xFFE5E0DA) + val LightAmber100 = Color(0xFFE5E0DA) @Stable - val LightYellow200 = Color(0xFFCCC1B5) + val LightAmber200 = Color(0xFFCCC1B5) @Stable - val LightYellow300 = Color(0xFFB2A38F) + val LightAmber300 = Color(0xFFB2A38F) @Stable - val LightYellow400 = Color(0xFF99846A) + val LightAmber400 = Color(0xFF99846A) @Stable - val LightYellow500 = Color(0xFF7F6545) + val LightAmber500 = Color(0xFF7F6545) @Stable - val LightYellow600 = Color(0xFF665137) + val LightAmber600 = Color(0xFF665137) @Stable - val LightYellow700 = Color(0xFF4C3D29) + val LightAmber700 = Color(0xFF4C3D29) @Stable - val LightYellow800 = Color(0xFF4C3D29) + val LightAmber800 = Color(0xFF4C3D29) @Stable - val LightYellow900 = Color(0xFF261E15) + val LightAmber900 = Color(0xFF261E15) @Stable val DarkBlue50 = Color(0xFFEEF7FF) @@ -261,25 +261,25 @@ object WireColorPalette { val DarkRed900 = Color(0xFF4D2422) @Stable - val DarkYellow50 = Color(0xFFFFFBEA) + val DarkAmber50 = Color(0xFFFFFBEA) @Stable - val DarkYellow100 = Color(0xFFFFF6D4) + val DarkAmber100 = Color(0xFFFFF6D4) @Stable - val DarkYellow200 = Color(0xFFFFEEA8) + val DarkAmber200 = Color(0xFFFFEEA8) @Stable - val DarkYellow300 = Color(0xFFFFE57D) + val DarkAmber300 = Color(0xFFFFE57D) @Stable - val DarkYellow400 = Color(0xFFFFDD51) + val DarkAmber400 = Color(0xFFFFDD51) @Stable - val DarkYellow500 = Color(0xFFFFD426) + val DarkAmber500 = Color(0xFFFFD426) @Stable - val DarkYellow600 = Color(0xFFCCAA1E) + val DarkAmber600 = Color(0xFFCCAA1E) @Stable - val DarkYellow700 = Color(0xFF997F17) + val DarkAmber700 = Color(0xFF997F17) @Stable - val DarkYellow800 = Color(0xFF66550F) + val DarkAmber800 = Color(0xFF66550F) @Stable - val DarkYellow900 = Color(0xFF4D400B) + val DarkAmber900 = Color(0xFF4D400B) @Stable val Gray10 = Color(0xFFFAFAFA) diff --git a/app/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt b/app/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt index 67293aee14..8d3499e1fd 100644 --- a/app/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt +++ b/app/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt @@ -66,7 +66,7 @@ data class WireColorScheme( val scrim: Color, val labelText: Color, val badge: Color, val onBadge: Color, - val highLight: Color, + val highlight: Color, val onHighlight: Color, val uncheckedColor: Color, val disabledCheckedColor: Color, val disabledIndeterminateColor: Color, @@ -139,7 +139,7 @@ private val LightWireColorScheme = WireColorScheme( primaryVariant = WireColorPalette.LightBlue50, onPrimaryVariant = WireColorPalette.LightBlue500, error = WireColorPalette.LightRed500, onError = Color.White, errorOutline = WireColorPalette.LightRed200, - warning = WireColorPalette.LightYellow500, onWarning = Color.White, + warning = WireColorPalette.LightAmber500, onWarning = Color.White, positive = WireColorPalette.LightGreen500, onPositive = Color.White, background = WireColorPalette.Gray20, onBackground = Color.Black, backgroundVariant = WireColorPalette.Gray10, onBackgroundVariant = Color.Black, @@ -172,7 +172,7 @@ private val LightWireColorScheme = WireColorScheme( scrim = WireColorPalette.BlackAlpha55, labelText = WireColorPalette.Gray80, badge = WireColorPalette.Gray90, onBadge = Color.White, - highLight = WireColorPalette.DarkYellow300, + highlight = WireColorPalette.DarkAmber200, onHighlight = Color.Black, uncheckedColor = WireColorPalette.Gray80, disabledCheckedColor = WireColorPalette.Gray80, disabledIndeterminateColor = WireColorPalette.Gray80, @@ -197,9 +197,9 @@ private val LightWireColorScheme = WireColorScheme( WireColorPalette.LightPurple500, WireColorPalette.LightPurple700, // Yellow - Amber - WireColorPalette.LightYellow300, - WireColorPalette.LightYellow500, - WireColorPalette.LightYellow700, + WireColorPalette.LightAmber300, + WireColorPalette.LightAmber500, + WireColorPalette.LightAmber700, // Petrol WireColorPalette.LightPetrol300, WireColorPalette.LightPetrol500, @@ -248,7 +248,7 @@ private val DarkWireColorScheme = WireColorScheme( primaryVariant = WireColorPalette.DarkBlue800, onPrimaryVariant = WireColorPalette.DarkBlue300, error = WireColorPalette.DarkRed500, onError = Color.Black, errorOutline = WireColorPalette.DarkRed800, - warning = WireColorPalette.DarkYellow500, onWarning = Color.Black, + warning = WireColorPalette.DarkAmber500, onWarning = Color.Black, positive = WireColorPalette.DarkGreen500, onPositive = Color.Black, background = WireColorPalette.Gray100, onBackground = Color.White, backgroundVariant = WireColorPalette.Gray95, onBackgroundVariant = Color.White, @@ -281,7 +281,7 @@ private val DarkWireColorScheme = WireColorScheme( scrim = WireColorPalette.BlackAlpha55, labelText = WireColorPalette.Gray30, badge = WireColorPalette.Gray10, onBadge = Color.Black, - highLight = WireColorPalette.DarkYellow300, + highlight = WireColorPalette.DarkAmber300, onHighlight = Color.Black, uncheckedColor = WireColorPalette.Gray60, disabledCheckedColor = WireColorPalette.Gray80, disabledIndeterminateColor = WireColorPalette.Gray80, @@ -306,9 +306,9 @@ private val DarkWireColorScheme = WireColorScheme( WireColorPalette.DarkPurple500, WireColorPalette.DarkPurple700, // Yellow - Amber - WireColorPalette.DarkYellow300, - WireColorPalette.DarkYellow500, - WireColorPalette.DarkYellow700, + WireColorPalette.DarkAmber300, + WireColorPalette.DarkAmber500, + WireColorPalette.DarkAmber700, // Petrol WireColorPalette.DarkPetrol300, WireColorPalette.DarkPetrol500,