I have this code:
// Border Color
@State private var activeWindowBorderColorText: String = UserDefaults.standard.string(forKey: "ActiveWindowBorderColor") ?? "775759"
let red = $activeWindowBorderColorText[1..<2]
@State private var activeWindowBorderColor = Color(.sRGB, red: red, green: 1, blue: 1)
What must I do to get the red, green and blue component from the string as parameters for the Color()? So, how to get the substrings?
I tried the extension from here: How does String substring work in Swift
but it gives me: Cannot use instance member '$activeWindowBorderColorText' within property initializer; property initializers run before 'self' is available