diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/html/ColorWheel.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/html/ColorWheel.kt index b5f5ba8..ec41230 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/html/ColorWheel.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/html/ColorWheel.kt @@ -10,11 +10,11 @@ class ColorWheel( private val log: Logger = LoggerFactory.getLogger(javaClass) - override fun toHtml(configHolder: ConfigHolder): String { + override fun toHtml(configHolder: ConfigHolder?): String { return toHtml(configHolder, false) } - fun toHtml(configHolder: ConfigHolder, oddEven: Boolean): String { + fun toHtml(configHolder: ConfigHolder?, oddEven: Boolean): String { val wheelId = id!!.replace(" ", "") val sb = StringBuilder() @@ -50,17 +50,17 @@ class ColorWheel( sb.append("\t\t\n") } - private fun renderScript(sb: StringBuilder, wheelId: String, oddEven: Boolean, configHolder: ConfigHolder) { + private fun renderScript(sb: StringBuilder, wheelId: String, oddEven: Boolean, configHolder: ConfigHolder?) { if (oddEven) { sb.append("\t\t\n") } else { - val hexColor = configHolder.getFadeable(wheelId) + val hexColor = configHolder?.getFadeable(wheelId) ?.getRgbColor()?.web() - ?:configHolder.getColor(wheelId) + ?:configHolder?.getColor(wheelId) ?:"000000" sb.append("\t\t