What's the "accentColor"?

It’s used as a modifier. But it exists as a general term in iOS and MacOS as well. You can set the color of a button with it.
Button("Some example") {}.accentColor(.green)
But foregroundColor-modifier seems to work the same: Button("Some example") {}.foregroundColor(.green)

Currently confused. What does the term mean in general and how does it distinguish from foregroundColor?

@mzech

This is the Apple documentation and description. I can’t think if any other way of describing the reason behind it.

1 Like

Accent color would be a general thing that you may set throughout your entire app, but foregroundColor would be used for one specific instance.

The default “accentColor” is blue, like on an iPhone, messages the create new message button and Edit button are blues that’s the accent color by default

But see in Mac’s system settings > Appearance > accent color

You’ll see small things like the drop-down arrow change colors, in different programs, like a more global setting

1 Like