mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-17 15:32:48 +00:00
brighten a bit more when color is really dark
This commit is contained in:
parent
5dbf6c5e60
commit
726e923f79
1 changed files with 5 additions and 1 deletions
|
@ -36,7 +36,11 @@ fun adjustLuminosityAndKeepAlpha(@ColorInt color: Int, amount: Float): Int {
|
|||
}
|
||||
|
||||
@ColorInt
|
||||
fun brighten(@ColorInt color: Int) = adjustLuminosityAndKeepAlpha(color, 0.06f)
|
||||
fun brighten(@ColorInt color: Int) =
|
||||
if (Color.red(color) < 20 && Color.green(color) < 15 && Color.blue(color) < 25)
|
||||
adjustLuminosityAndKeepAlpha(color, 0.09f) // really dark colors need more brightening
|
||||
else
|
||||
adjustLuminosityAndKeepAlpha(color, 0.06f)
|
||||
|
||||
@ColorInt
|
||||
fun darken(@ColorInt color: Int) = adjustLuminosityAndKeepAlpha(color, -0.06f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue