How to get a button's default background color when pressed?

Viewed 142

How do I get the default highlighted color of a Button?

For example, when I tap the button rendered by the code below, the row background color turns light gray, specifically red: 209, green: 209, and blue: 214. But I'm wondering how I can get the value of that color programmatically, without hard coding it, in case Apple decides to change it in a later release, or something.

var body: some View {
  List {
    Button("Test") { print("Button pressed") }
  }
}
0 Answers
Related