allowedDynamicRange

Returns a new image configured with the specified allowed dynamic range.

Image ModifieriOS 17.0+macOS 14.0+tvOS 17.0+allowedDynamicRange(_:) in SwiftUI

Declaration

React
compose().allowedDynamicRange(
  range: SwiftUI.ImageDynamicRange | null
)
Swift
func allowedDynamicRange(_ range: Image.DynamicRange?) -> Image

Parameters

Return value

a new image.

Discussion

The following example enables HDR rendering for a specific image view, assuming that the image has an HDR (ITU-R 2100) color space and the output device supports it:

Image("hdr-asset").allowedDynamicRange(.high)

See also

More in Image modifiers.