In [D_Gen3.memgraph](https://www.icloud.com/iclouddrive/0LtdPSX5nfEWcpd7ZQPu7fP2Q#Memgraphs), Xcode memory debugger reports one leaked type, the `Color` for the bullseye in an HSV color picker, which adapts to brightness. Instruments would report thousands of leaks, 99% not referring to app code. ``` % leaks D_Gen3.memgraph 9 com.apple.SwiftUI 0x1c94e6318 partial apply for closure #1 in ViewBodyAccessor.updateBody(of:changed:) + 44 8 Inclusivity 0x102dc53e8 protocol witness for View.body.getter in conformance HSVHueSatWheelBullseye + 40 <compiler-generated>:0 7 Inclusivity 0x102dc3594 HSVHueSatWheelBullseye.body.getter + 820 HSVHueSatWheelBullseye.swift:12 6 com.apple.SwiftUI 0x1c9e748ac ZStack.init(alignment:content:) + 180 5 Inclusivity 0x102dc409c closure #1 in HSVHueSatWheelBullseye.body.getter + 960 HSVHueSatWheelBullseye.swift:20 4 Inclusivity 0x10317f9ec HSVColorPickerVM.targetRingColor.getter + 292 HSVColorPickerVM.swift:198 3 com.apple.SwiftUI 0x1c98e888c Color.init(hue:saturation:brightness:opacity:) + 80 2 libswiftCore.dylib 0x1b1e2c9b4 swift_allocObject + 64 1 libswiftCore.dylib 0x1b1e2c7bc swift_slowAlloc + 64 0 libsystem_malloc.dylib 0x1a4377bc8 _malloc_zone_malloc + 160 1 (48 bytes) ROOT LEAK: <SwiftUI.(ColorBox in $1c9f228c0)<SwiftUI.Color.Resolved> 0x12bb86c80> [48] ``` This is the getter for that Color [in an `ObservableObject`,](https://github.com/importRyan/InclusivityDevelopment/blob/437c9caba2940eb95a2084b28517c8573466ad9d/Inclusivity/Presentation/Inspector/ColorInspector/ManualColorPicker/HSVPicker/HSVColorPickerVM.swift#L196) whose lifetime and count is exactly as expected. ``` var targetRingColor: Color { currentSharedColor.val > 0.55 ? Color(hue: 0, saturation: 0, brightness: min(0.2, 1 - Double(currentSharedColor.val))) // currentSharedColor is a private value type : Color(hue: 0, saturation: 0, brightness: max(0.8, 1 - Double(currentSharedColor.val))) } ``` and here it is in a [View](https://github.com/importRyan/InclusivityDevelopment/blob/437c9caba2940eb95a2084b28517c8573466ad9d/Inclusivity/Presentation/Inspector/ColorInspector/ManualColorPicker/HSVPicker/HSVHueSatWheel/HSVHueSatWheelBullseye.swift ) ``` Circle().fill(vm.targetRingColor) .frame(width: vm.hsBullseyeDiameter, height: vm.hsBullseyeDiameter) .transition(AnyTransition.scale.animation(.easeInOut)) .animate(.easeIn, value: vm.hideBullseye) .animate(.easeIn, value: vm.hsBullseyeDiameter) ``` The .animate modifier is just [sugar](https://github.com/importRyan/InclusivityDevelopment/blob/437c9caba2940eb95a2084b28517c8573466ad9d/Inclusivity/Presentation/_Support/Modifiers/ReduceMotion%2B.swift) for respecting ReduceMotion. (PS. Please add a zero-effort way to low key or cut off motion by an API like this!)