---
title: "hueRotation(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/huerotation(_:)"
---

# hueRotation(_:)

Applies a hue rotation effect to this view.

## Declaration

```swift
nonisolated func hueRotation(_ angle: Angle) -> some View

```

## Parameters

- `angle`: The hue rotation angle to apply to the colors in this view.

## Return Value

Return Value A view that applies a hue rotation effect to this view.

## Discussion

Discussion Use hue rotation effect to shift all of the colors in a view according to the angle you specify. The example below shows a series of squares filled with a linear gradient. Each square shows the effect of a 36˚ hueRotation (a total of 180˚ across the 5 squares) on the gradient: struct HueRotation: View {     var body: some View {         HStack {             ForEach(0..<6) {                 Rectangle()                     .fill(.linearGradient(                         colors: [.blue, .red, .green],                         startPoint: .top, endPoint: .bottom))                     .hueRotation((.degrees(Double($0 * 36))))                     .frame(width: 60, height: 60, alignment: .center)             }         }     } }

## See Also

### Transforming colors

- [brightness(_:)](swiftui/view/brightness(_:).md)
- [contrast(_:)](swiftui/view/contrast(_:).md)
- [colorInvert()](swiftui/view/colorinvert().md)
- [colorMultiply(_:)](swiftui/view/colormultiply(_:).md)
- [saturation(_:)](swiftui/view/saturation(_:).md)
- [grayscale(_:)](swiftui/view/grayscale(_:).md)
- [luminanceToAlpha()](swiftui/view/luminancetoalpha().md)
- [materialActiveAppearance(_:)](swiftui/view/materialactiveappearance(_:).md)
- [materialActiveAppearance](swiftui/environmentvalues/materialactiveappearance.md)
- [MaterialActiveAppearance](swiftui/materialactiveappearance.md)
