From 6c2e3cd316698ae05ba1fa073a8ca3071e6947fc Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 28 Nov 2023 21:18:59 -0800 Subject: [PATCH] Hook up the color picker --- .../Settings/Config/Module/AmbientLightingConfig.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift b/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift index 17a44545..f5e9dc26 100644 --- a/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift @@ -149,9 +149,10 @@ struct AmbientLightingConfig: View { func setAmbientLightingConfigValue() { self.ledState = node?.ambientLightingConfig?.ledState ?? false self.current = Int(node?.ambientLightingConfig?.current ?? 10) - color = Color(red: Double((node?.ambientLightingConfig?.red ?? 255) / 255), - green: Double((node?.ambientLightingConfig?.green ?? 255) / 255), - blue: Double((node?.ambientLightingConfig?.blue ?? 255) / 255)) + let red = Double(node?.ambientLightingConfig?.red ?? 255) + let green = Double(node?.ambientLightingConfig?.green ?? 255) + let blue = Double(node?.ambientLightingConfig?.blue ?? 255) + color = Color(red: red / 255.0, green: green / 255.0, blue: blue / 255.0) self.hasChanges = false } }