I want to create a gradient color for my widget using custom colors. And I have a problem when I only use two colors, as a result, not one of the colors is applied, but the background turns green!

```
struct WeatherWidgetMediumView: View {

    var gradient: LinearGradient {
        LinearGradient(
            gradient: Gradient(
                colors:
                [
                    Color(red: 96.0/255.0, green: 171.0/255.0, blue: 239.0/255.0),
                    Color(red: 163.0/255.0, green: 230.0/255.0, blue: 244.0/255.0)
                ]),
            startPoint: .top,
            endPoint: .bottom)
    }

    var body: some View {
        GeometryReader { geo in
            HStack(alignment: .center) {
                Divider().background(Color.black).padding(.vertical, 16.0).opacity(0.1)
            }
        }
        .background(gradient)
    }
}

```

[![enter image description here](https://i.stack.imgur.com/cAFDw.png)](https://i.stack.imgur.com/cAFDw.png)

But If I added one more color it's looks great.

```
struct WeatherWidgetMediumView: View {
    let weather: Weather

    var gradient: LinearGradient {
        LinearGradient(
            gradient: Gradient(
                colors:
                [
                    Color(red: 96.0/255.0, green: 171.0/255.0, blue: 239.0/255.0),
                    Color(red: 96.0/255.0, green: 171.0/255.0, blue: 239.0/255.0),
                    Color(red: 163.0/255.0, green: 230.0/255.0, blue: 244.0/255.0)
                ]),
            startPoint: .top,
            endPoint: .bottom)
    }

    var body: some View {
        GeometryReader { geo in
            HStack(alignment: .center) {
                Divider().background(Color.black).padding(.vertical, 16.0).opacity(0.1)
            }
            Spacer()
        }
        .background(gradient)
    }
}

```

[![enter image description here](https://i.stack.imgur.com/rPs99.png)](https://i.stack.imgur.com/rPs99.png)

UPD: Create a GitHub project with this issue

<https://github.com/Maxim-Zakopaylov/widgetKitGradientIssue>