I'm stuck with some UI-work in my macOS app, currently designing form elements. I am trying to stay in SwiftUI, but I guess running to the limits of it.
All my input elements should have the same background color (see image, #1)
In the DatePicker() I managed to set the background color and crop it with
.background(
RoundedRectangle(cornerRadius: 10)
.fill(Color.myBackgroundColor)
)
but it still has a slightly different color in the text field (around the arrows it's correct, where I marked it with 2 it is a litte bit brighter)
Even worse is the picker (3): The color is set to the same value, but some overlay makes it way brighter. My modifier looks like this:
.background(Color.myBackgroundColor)
.cornerRadius(10)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(Color.myBorderColor, lineWidth: 1)
)
Also, is there a way to change the blue of the picker (4)?
Probably I need to find a similar solution like in the TextEditor() where I used this:
extension NSTextView {
open override var frame: CGRect {
didSet {
backgroundColor = .clear //<<here clear
drawsBackground = true
}
}
}