> 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/shapes/shape/sports-car-in-sunset.md).

# Sports Car in Sunset

{% tabs %}
{% tab title="👁️ 預覽" %}
{% embed url="<https://youtu.be/z0HRcNQPDkA>" %}

⬆️ 需要： [Vehicle](/ios/swiftui/shapes/shape/sports-car-in-sunset/vehicle.md)

```swift
import SwiftUI

struct SunsetSportsCar: View {
    var body: some View {
        ZStack {
            sunset
            Vehicle()    // 🖼 Vehicle
        }
        .frame(width: 400)
    }
}

extension SunsetSportsCar {
    /// sunset behind sports car
    var sunset: some View {
        Circle()
            .fill(.diagonal(.white, .yellow, .orange, .red, .clear))
            .padding(40)
    }
}
```

{% endtab %}

{% tab title="📗 參考" %}

* [ ] Angie Terrell ⟩ [Be a square – create custom shapes with SwiftUI](https://bignerdranch.com/blog/be-a-square-create-custom-shapes-with-swiftui/)
  {% endtab %}

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

* uses [Vehicle](/ios/swiftui/shapes/shape/sports-car-in-sunset/vehicle.md) as a part.
  {% endtab %}
  {% endtabs %}
