aboutsummaryrefslogtreecommitdiff
path: root/library/src/main/kotlin/ca/allanwang/kau/dialogs/color/CircleView.kt
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/main/kotlin/ca/allanwang/kau/dialogs/color/CircleView.kt')
-rw-r--r--library/src/main/kotlin/ca/allanwang/kau/dialogs/color/CircleView.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/src/main/kotlin/ca/allanwang/kau/dialogs/color/CircleView.kt b/library/src/main/kotlin/ca/allanwang/kau/dialogs/color/CircleView.kt
index 1b5e0fe..3430b42 100644
--- a/library/src/main/kotlin/ca/allanwang/kau/dialogs/color/CircleView.kt
+++ b/library/src/main/kotlin/ca/allanwang/kau/dialogs/color/CircleView.kt
@@ -197,6 +197,7 @@ class CircleView @JvmOverloads constructor(context: Context, attrs: AttributeSet
companion object {
@ColorInt
+ @JvmStatic
private fun translucentColor(color: Int): Int {
val factor = 0.7f
val alpha = Math.round(Color.alpha(color) * factor)
@@ -207,6 +208,7 @@ class CircleView @JvmOverloads constructor(context: Context, attrs: AttributeSet
}
@ColorInt
+ @JvmStatic
fun shiftColor(@ColorInt color: Int,
@FloatRange(from = 0.0, to = 2.0) by: Float): Int {
if (by == 1f) return color
@@ -216,9 +218,11 @@ class CircleView @JvmOverloads constructor(context: Context, attrs: AttributeSet
}
@ColorInt
+ @JvmStatic
fun shiftColorDown(@ColorInt color: Int): Int = shiftColor(color, 0.9f)
@ColorInt
+ @JvmStatic
fun shiftColorUp(@ColorInt color: Int): Int = shiftColor(color, 1.1f)
}
} \ No newline at end of file