aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2021-10-24 17:45:09 -0700
committerAllan Wang <me@allanwang.ca>2021-10-24 17:45:09 -0700
commit222709bc15ace77ebf03e5a8e17e0bf026520970 (patch)
tree802f80dc3e6956b9e8bdf15f4d265f3b863fa58d /core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt
parent8c95d32ce4a82ec00590c428d163a3604b7d44ec (diff)
downloadkau-222709bc15ace77ebf03e5a8e17e0bf026520970.tar.gz
kau-222709bc15ace77ebf03e5a8e17e0bf026520970.tar.bz2
kau-222709bc15ace77ebf03e5a8e17e0bf026520970.zip
Many version bumps
Diffstat (limited to 'core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt
index 0131302..29c0919 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt
@@ -89,9 +89,11 @@ fun Int.isColorVisibleOn(
@IntRange(from = 0L, to = 255L) minAlpha: Int = 50
): Boolean =
if (Color.alpha(this) < minAlpha) false
- else !(abs(Color.red(this) - Color.red(color)) < delta &&
- abs(Color.green(this) - Color.green(color)) < delta &&
- abs(Color.blue(this) - Color.blue(color)) < delta)
+ else !(
+ abs(Color.red(this) - Color.red(color)) < delta &&
+ abs(Color.green(this) - Color.green(color)) < delta &&
+ abs(Color.blue(this) - Color.blue(color)) < delta
+ )
@ColorInt
fun Context.getDisabledColor(): Int {