Contents

MaterialActiveAppearance

The behavior for how materials appear active and inactive.

Declaration

struct MaterialActiveAppearance

Overview

On macOS, materials have active and inactive appearances that can reinforce the active appearance of the window they are in:

  • Materials used as a window container background and bar materials will appear inactive when their containing window is inactive.

  • All other materials will always appear active by default.

An explicit active appearance can be set to override a material’s default behavior. For example, materials used as the window container background can be made to always appear active by setting the active appearance behavior to be always active:

Text("Hello, World!")
    .containerBackground(
        Material.regular.materialActiveAppearance(.active),
        for: .window)

Topics

Type Properties

See Also

Transforming colors