---
title: "foregroundColor(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/foregroundcolor(_:)"
---

# foregroundColor(_:)

Sets the color of the foreground elements displayed by this view.

## Declaration

```swift
nonisolated func foregroundColor(_ color: Color?) -> some View

```

## Parameters

- `color`: The foreground color to use when displaying this view. Pass nil to remove any custom foreground color and to allow the system or the container to provide its own foreground color. If a container-specific override doesn’t exist, the system uses the primary color.

## Return Value

Return Value A view that uses the foreground color you supply.

## See Also

### Appearance modifiers

- [colorScheme(_:)](swiftui/view/colorscheme(_:).md)
- [listRowPlatterColor(_:)](swiftui/view/listrowplattercolor(_:).md)
- [background(_:alignment:)](swiftui/view/background(_:alignment:).md)
- [overlay(_:alignment:)](swiftui/view/overlay(_:alignment:).md)
- [complicationForeground()](swiftui/view/complicationforeground().md)
