Skip to content

Commit 90bd3fb

Browse files
committed
Fix custom ColorScheme
1 parent 0b63c4d commit 90bd3fb

File tree

1 file changed

+4
-4
lines changed
  • core/src/main/kotlin/io/github/rothes/esu/core/colorscheme

1 file changed

+4
-4
lines changed

core/src/main/kotlin/io/github/rothes/esu/core/colorscheme/ColorScheme.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ data class ColorScheme(
3030
val errorDim: TextColor = hex("#ff5050"),
3131
): ConfigurationPart {
3232

33-
@Transient
3433
@Suppress("SpellCheckingInspection")
35-
private val colors =
34+
private val colors by lazy(LazyThreadSafetyMode.NONE) {
3635
listOf(
3736
primary to "pc",
3837
primaryDim to "pdc",
@@ -47,10 +46,10 @@ data class ColorScheme(
4746
error to "ec",
4847
errorDim to "edc",
4948
)
49+
}
5050

51-
@Transient
5251
@Suppress("SpellCheckingInspection")
53-
val tagResolver: TagResolver =
52+
val tagResolver: TagResolver by lazy(LazyThreadSafetyMode.NONE) {
5453
TagResolver.builder()
5554
.color(primary, "pc", "primary_color")
5655
.color(primaryDim, "pdc", "primary_dim_color")
@@ -66,6 +65,7 @@ data class ColorScheme(
6665
.color(errorDim, "edc", "error_dim_color")
6766
.resolver(ColorTagResolver())
6867
.build()
68+
}
6969

7070
private fun TagResolver.Builder.color(color: TextColor, vararg keys: String): TagResolver.Builder {
7171
resolver(EsuColorTagResolver(keys.toList(), color))

0 commit comments

Comments
 (0)