RadialGradients.swift 849 B

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