LinearGradients.swift 849 B

12345678910111213141516171819202122
  1. extension BackendFeatures {
  2. /// Backend methods for linear gradients.
  3. ///
  4. /// Used by ``LinearGradient``.
  5. public protocol LinearGradients: Core {
  6. /// Creates the widget for a ``LinearGradient``.
  7. func createLinearGradientWidget() -> Widget
  8. /// Updates the widget of a ``LinearGradient``.
  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 updateLinearGradientWidget(
  15. _ widget: Widget,
  16. gradient: LinearGradient,
  17. withSize size: SIMD2<Int>,
  18. in environment: EnvironmentValues
  19. )
  20. }
  21. }