Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ec34bdb authored by tibbi's avatar tibbi
Browse files

return BLACK when trying to darken BLACK color

parent b2d3bbf2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -15,7 +15,10 @@ import android.provider.DocumentsContract
import android.provider.MediaStore
import android.support.v4.provider.DocumentFile
import android.support.v7.app.AlertDialog
import android.view.*
import android.view.View
import android.view.ViewGroup
import android.view.Window
import android.view.WindowManager
import android.view.inputmethod.InputMethodManager
import android.widget.EditText
import android.widget.TextView
@@ -621,7 +624,7 @@ fun Activity.setupDialogStuff(view: View, dialog: AlertDialog, titleId: Int = 0,

    var title: TextView? = null
    if (titleId != 0) {
        title = LayoutInflater.from(this).inflate(R.layout.dialog_title, null) as TextView
        title = layoutInflater.inflate(R.layout.dialog_title, null) as TextView
        title.dialog_title_textview.apply {
            setText(titleId)
            setTextColor(baseConfig.textColor)
+3 −0
Original line number Diff line number Diff line
@@ -43,7 +43,10 @@ fun ClosedRange<Int>.random() = Random().nextInt(endInclusive - start) + start
fun Int.darkenColor(): Int {
    if (this == Color.WHITE) {
        return -2105377
    } else if (this == Color.BLACK) {
        return Color.BLACK
    }

    val DARK_FACTOR = 8
    var hsv = FloatArray(3)
    Color.colorToHSV(this, hsv)