Skip to content

Implement LinearGradient #502

@Kyle-Ye

Description

@Kyle-Ye

Description

LinearGradient is a fundamental gradient type in SwiftUI that creates a gradient between colors along a linear axis. This is currently missing from OpenSwiftUI.

API Reference

SwiftUI's LinearGradient: https://developer.apple.com/documentation/swiftui/lineargradient

Expected API

struct LinearGradient: ShapeStyle, View {
    init(gradient: Gradient, startPoint: UnitPoint, endPoint: UnitPoint)
    init(colors: [Color], startPoint: UnitPoint, endPoint: UnitPoint)
    init(stops: [Gradient.Stop], startPoint: UnitPoint, endPoint: UnitPoint)
}

Use Case

Required for the AnimatedColorTimelineView example and many other gradient-based UI designs.

References

  • Example usage commented out in: Example/SharedExample/Animation/Timeline/AnimatedColorTimelineView.swift

Priority

Medium - Common UI element for creating gradient backgrounds and fills

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Medium priorityenhancementNew feature or requesthelp wantedPR contribution is appreciated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions