Angular Gradient
Angular Gradient
```
struct AngularGradientView: View {
let colors: [Color] = [.yellow, .red,.blue, .purple]

- Parameters:
- gradient: The gradient with the colors to use.
- center: The unit point that is center of the angular gradient.
- startAngle: The ``Angle`` where the gradient starts. Defaults to zero.
- endAngle: The ``Angle`` where the gradient ends. Defaults to zero.
Creates an angular gradient starting at and angle and going all the way around
in a circle.
For example,
```
struct ExampleView: View {
let colors: [Color] = [.yellow, .red,.blue, .purple]

- Parameters:
- gradient: The gradient with the colors to use.
- center: The unit point that is center of the angular gradient.
- angle: The ``Angle`` where the gradient starts. Defaults to zero.
The type of view representing the body of this view.
When you create a custom view, Swift infers this type from your
implementation of the required `body` property.
Animate a view when data changes.
Use `Animatable` when you are unable to achieve the animation you want with
``View/animation(_:)`` or ``withAnimation(_:_:)``.
For example:
```
struct ExampleView: View {
@State var numberOfShakes: CGFloat = 0
Note:
- `shakeNumber` represents the *progress* of the animation. The SwiftUI
runtime can set this value through ``Animatable/animatableData-7101d``,
and it can be any value between the initial and the final value (`0.0`
and `10.0` in this case).
- `shakeNumber` is a `CGFloat` and not an `Int`. This is because the
runtime needs to be able to interpolate fractionally between `0.0` and
`10.0` 'shakes' - and it does so by making use of `CGFloat`'s
``VectorArithmetic`` conformance.
- The exact mathematical function used to interpolate `shakeNumber` is
determined by what type of ``Animation`` is used in
``withAnimation(_:_:)``, to animate the change from `0` shakes to `10`
shakes.
```
struct ExampleView: View {
@State var progress: CGFloat = 0
![A gif that displays a VStack containing the text "Banana🍌🍌", which
has been animated to endlessly move in a circular motion around the view.]
(https://bananadocs-documentation-assets.s3-us-west-2.amazonaws.com/Animatable-
example-2.gif)