AngularGradients.swift 867 B

12345678910111213141516171819202122
  1. extension BackendFeatures {
  2. /// Backend methods for angular (conic) gradients.
  3. ///
  4. /// Used by ``AngularGradient``.
  5. public protocol AngularGradients: Core {
  6. /// Creates the widget for an ``AngularGradient``.
  7. func createAngularGradientWidget() -> Widget
  8. /// Updates the widget of an ``AngularGradient``.
  9. /// - Parameters:
  10. /// - widget: The widget to update.
  11. /// - gradient: The SwiftCrossUI struct housing the information for the gradient's rendering.
  12. /// - size: The new size of the widget.
  13. /// - environment: The widget's environment, used to resolve its colors.
  14. func updateAngularGradientWidget(
  15. _ widget: Widget,
  16. gradient: AngularGradient,
  17. withSize size: SIMD2<Int>,
  18. in environment: EnvironmentValues
  19. )
  20. }
  21. }