From 8bfd50e0c0d8401a6a6e8e2cf0987e0b81770d42 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 25 Aug 2024 03:28:55 +0200 Subject: [PATCH] Using better readable colors for amount from Tailwind color palette --- .../kotlin/net/codinux/banking/ui/service/Colors.kt | 11 +++++++++++ .../net/codinux/banking/ui/service/FormatUtil.kt | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/Colors.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/Colors.kt index f983621..72abca4 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/Colors.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/Colors.kt @@ -11,4 +11,15 @@ object Colors { val Zinc700 = Color(63, 63, 70) + + val Red600 = Color(220, 38, 38) + + + val Green600 = Color(22, 163, 74) + + val Green700 = Color(21, 128, 61) + + + val Emerald700 = Color(4, 120, 87) + } \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt index 335d6f2..b6574f5 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt @@ -44,8 +44,8 @@ class FormatUtil { } fun getColorForAmount(amount: Amount): Color = when { - amount.amount.startsWith("-") -> Color.Red - else -> Color.Green + amount.amount.startsWith("-") -> Colors.Red600 + else -> Colors.Green600 }