diff options
| author | Danny Lin <danny@kdrag0n.dev> | 2021-10-24 21:24:22 -0700 |
|---|---|---|
| committer | Danny Lin <danny@kdrag0n.dev> | 2021-10-24 21:25:02 -0700 |
| commit | 06670404ff52a7d35892a1b5a6a9192be0251116 (patch) | |
| tree | 9b10c39cfad702bbdb8c5bc371df327194e75770 /src/main/kotlin | |
| parent | 9b8f8b3b1797bd3b8718775df4ef35f9b4cafcb5 (diff) | |
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.
Diffstat (limited to 'src/main/kotlin')
| -rw-r--r-- | src/main/kotlin/dev/kdrag0n/monet/theme/DynamicColorScheme.kt | 10 |
1 files changed, 8 insertions, 2 deletions
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 @@ class DynamicColorScheme( 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 @@ class DynamicColorScheme( 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 @@ class DynamicColorScheme( 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 |
