diff options
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.kt | 8 |
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 { |