pull/32/head
kunfei 5 years ago
parent 721989d721
commit 1789d04034
  1. 5
      app/src/main/java/io/legado/app/help/ReadBookConfig.kt
  2. 3
      app/src/main/java/io/legado/app/utils/IntExtensions.kt

@ -9,7 +9,6 @@ import io.legado.app.utils.*
import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import okhttp3.internal.toHexString
import java.io.BufferedWriter
import java.io.File
import java.io.FileWriter
@ -126,9 +125,9 @@ object ReadBookConfig {
fun setTextColor(color: Int) {
if (App.INSTANCE.isNightTheme) {
textColorNight = "#${color.toHexString()}"
textColorNight = "#${color.hexString}"
} else {
textColor = "#${color.toHexString()}"
textColor = "#${color.hexString}"
}
}

@ -11,3 +11,6 @@ val Int.sp: Int
get() = android.util.TypedValue.applyDimension(
android.util.TypedValue.COMPLEX_UNIT_SP, this.toFloat(), Resources.getSystem().displayMetrics
).toInt()
val Int.hexString: String
get() = Integer.toHexString(this)
Loading…
Cancel
Save