<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Color/headroom(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI5ColorV8headroomyACSdSgF"
  },
  "title" : "headroom(_:)"
}
-->

# headroom(_:)

Creates a new color with specified HDR content headroom.

```
func headroom(_ headroom: Double?) -> Color
```

## Parameters

`headroom`

the headroom value to associate with the
new color.

## Return Value

a new color with the specified content headroom.

## Discussion

High Dynamic Range colors (those with RGB components outside
the standard [0, 1] range) should be annotated with their
headroom to ensure that they are displayed correctly. Knowing
content headroom allows the rendering system to automatically
increase display headroom when the color is displayed and to
tone map the color when the available display headroom is
insufficient to render the color as intended.

For example a custom yellow color whose brightness has been
increased by two exposure levels:

```
Color(.sRGB, red: 1.83, green: 1.47, blue: 0)
    .headroom(4)
```

note that headroom is a linear quantity, and as such any color
adjustments should typically be made in a linear color space.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)