> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/ios/swiftui/view/drawing/foreground/style/shapestyle.foreground.md).

# ShapeStyle.foreground

[SwiftUI](/ios/swiftui.md) ⟩ [view](/ios/swiftui/view.md) ⟩ [drawing](/ios/swiftui/view/drawing.md) ⟩ [foreground](/ios/swiftui/view/drawing/foreground.md) ⟩ [style](/ios/swiftui/view/drawing/foreground/style.md) ⟩ <mark style="color:purple;">`.foreground`</mark>

{% hint style="success" %}
[foreground style](/ios/swiftui/view/drawing/foreground/style.md) in the <mark style="color:yellow;">current context</mark>.
{% endhint %}

{% tabs %}
{% tab title="💾 程式" %}

```swift
Circle()
    //      ╭── ⭐️ ───╮
    .stroke(.foreground, lineWidth: 20)    // default: .blue
    .frame(width: 100, height: 100)
```

<figure><img src="/files/qrnBrMxatzUyRN3N6X2E" alt=""><figcaption><p>stroke with <mark style="color:blue;"><code>.foreground</code></mark> shape style</p></figcaption></figure>
{% endtab %}

{% tab title="👥 相關" %}

* [view.foregroundStyle()](/ios/swiftui/view/drawing/foreground/style/view.foregroundstyle.md)：設定[<mark style="color:yellow;">前景元素</mark>](/ios/swiftui/view/drawing/foreground/foreground-element.md)的 [ShapeStyle](/ios/swiftui/shapes/shapestyle.md)。
* [foreground element](/ios/swiftui/view/drawing/foreground/foreground-element.md)：<mark style="color:yellow;">前景元素</mark>
  {% endtab %}

{% tab title="📘 手冊" %}

* [SwiftUI](https://developer.apple.com/documentation/swiftui) ⟩&#x20;
  * [ShapeStyle](https://developer.apple.com/documentation/swiftui/shapestyle) ⟩ [.foreground](https://developer.apple.com/documentation/swiftui/shapestyle/foreground) (<mark style="color:orange;">static</mark>)：[foreground style](/ios/swiftui/view/drawing/foreground/style.md) in the <mark style="color:yellow;">current context</mark>.
  * [View](https://developer.apple.com/documentation/swiftui/view) ⟩ [.foregroundStyle(\_:)](https://developer.apple.com/documentation/swiftui/view/foregroundstyle\(_:\))：
    {% endtab %}
    {% endtabs %}
