ImageDynamicRange

The range of brightness that an image is allowed to draw.

StructureiOS 17.0+macOS 14.0+tvOS 17.0+Image.DynamicRange in SwiftUI

Declaration

React
type ImageDynamicRange = 'constrainedHigh' | 'high' | 'standard';
Swift
struct DynamicRange

Pass a literal, or build one with SwiftUI.ImageDynamicRange from import { SwiftUI } from 'swiftui-react-native'.

Type properties

Overview

A high dynamic range image stores highlights brighter than white. Pass a value of this type to Image.allowedDynamicRange(_:) to say how much of that extra brightness reaches the display:

Image("sunset")
    .allowedDynamicRange(.constrainedHigh)

Use Image.DynamicRange.high when the image is the subject of the screen and you want it at full brightness. Prefer Image.DynamicRange.constrainedHigh when the image appears next to an ordinary interface, because an unrestricted image can make the content around it look dim. Image.DynamicRange.standard holds the image to the same range as the rest of the interface.

From Apple’s SwiftUI documentation. Code samples there are Swift.

Used by

See also

More in Visual effects.