import SwiftUI /// Four square blocks fill from bottom to top; partial blocks retain the actual fraction. struct SegmentedCoreBar: View { let value: Double? let color: Color static func portions(_ value: Double?, count: Int = 4) -> [Double] { guard count > 0 else { return [] } let fraction = value.flatMap { $0.isFinite ? min(1, max(0, $0)) : nil } ?? 0 return (0..