Skip to content

Commit 77fcb0e

Browse files
committed
Fine-tune icon colors
1 parent d6433e0 commit 77fcb0e

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

HTTPShortcuts/app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ android {
6565
// Version name and code must remain as literals so that F-Droid can read them
6666
versionName = "4.5.0"
6767
// 11,(2 digits major),(2 digits minor),(2 digits patch),(2 digits build)
68-
versionCode = 1104050000
68+
versionCode = 1104050001
6969

7070
buildConfigField("String", "BUGSNAG_API_KEY", "\"$bugsnagAPIKey\"")
7171
buildConfigField("long", "BUILD_TIMESTAMP", buildTimestamp.toString())

HTTPShortcuts/app/src/main/kotlin/ch/rmy/android/http_shortcuts/components/ShortcutIcon.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import androidx.compose.foundation.background
44
import androidx.compose.foundation.isSystemInDarkTheme
55
import androidx.compose.foundation.layout.Box
66
import androidx.compose.foundation.layout.aspectRatio
7+
import androidx.compose.foundation.layout.padding
78
import androidx.compose.foundation.layout.width
89
import androidx.compose.foundation.shape.CircleShape
910
import androidx.compose.foundation.shape.RoundedCornerShape
@@ -74,8 +75,8 @@ fun ShortcutIcon(
7475
?.luminance()
7576
?: return@withContext null
7677
when {
77-
iconLuminance > 0.9f && !isDarkMode -> Color.Black.copy(alpha = 0.7f)
78-
iconLuminance < 0.1f && isDarkMode -> Color.White.copy(alpha = 0.9f)
78+
iconLuminance > 0.75f && !isDarkMode -> Color.Black.copy(alpha = 0.7f)
79+
iconLuminance < 0.07f && isDarkMode -> Color.White.copy(alpha = 0.9f)
7980
else -> null
8081
}
8182
}
@@ -88,7 +89,9 @@ fun ShortcutIcon(
8889
clip(CircleShape)
8990
}
9091
.runIfNotNull(background) { background ->
91-
background(background, shape = RoundedCornerShape(percent = 25))
92+
val offset = size * 0.05f
93+
background(background, shape = RoundedCornerShape(percent = 30))
94+
.padding(offset)
9295
}
9396
.aspectRatio(1f)
9497

0 commit comments

Comments
 (0)