Disable debug logs by default
While the logging is useful for debugging, it causes performance issues
in the launcher now that we're using this theme library for generating
local wallpaper color palettes. Disale it by defautl and guard it with a
DEBUG flag to improve performance.
diff --git a/src/main/kotlin/dev/kdrag0n/monet/theme/DynamicColorScheme.kt b/src/main/kotlin/dev/kdrag0n/monet/theme/DynamicColorScheme.kt
index b411843..278417f 100644
--- a/src/main/kotlin/dev/kdrag0n/monet/theme/DynamicColorScheme.kt
+++ b/src/main/kotlin/dev/kdrag0n/monet/theme/DynamicColorScheme.kt
@@ -24,7 +24,9 @@
private val seedAccent = seedNeutral
init {
- Log.i(TAG, "Seed color: ${seedColor.convert<Srgb>().toHex()} => $seedNeutral")
+ if (DEBUG) {
+ Log.d(TAG, "Seed color: ${seedColor.convert<Srgb>().toHex()} => $seedNeutral")
+ }
}
// Main accent color. Generally, this is close to the seed color.
@@ -56,7 +58,10 @@
val newLch = transformColor(target, seed, reference)
val newSrgb = newLch.convert<Srgb>()
- Log.d(TAG, "Transform: [$shade] $target => $newLch => ${newSrgb.toHex()}")
+ if (DEBUG) {
+ Log.d(TAG, "Transform: [$shade] $target => $newLch => ${newSrgb.toHex()}")
+ }
+
shade to newSrgb
}.toMap()
}
@@ -92,6 +97,7 @@
companion object {
private const val TAG = "DynamicColorScheme"
+ private const val DEBUG = false
// Hue shift for the tertiary accent color (accent3), in degrees.
// 60 degrees = shifting by a secondary color