<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 14.0.0 -",
    "tvOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureDevice/deviceWhiteBalanceGains(for:)-3wtsa",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureDevice(im)deviceWhiteBalanceGainsForTemperatureAndTintValues:"
  },
  "title" : "deviceWhiteBalanceGains(for:)"
}
-->

# deviceWhiteBalanceGains(for:)

Converts device-independent temperature and tint values to device-specific white balance RGB gain values.

```
func deviceWhiteBalanceGains(for tempAndTintValues: AVCaptureDevice.WhiteBalanceTemperatureAndTintValues) -> AVCaptureDevice.WhiteBalanceGains
```

## Parameters

`tempAndTintValues`

An [`AVCaptureDevice.WhiteBalanceTemperatureAndTintValues`](/documentation/AVFoundation/AVCaptureDevice/WhiteBalanceTemperatureAndTintValues) structure containing the temperature and tint values.

## Return Value

A fully populated [`AVCaptureDevice.WhiteBalanceGains`](/documentation/AVFoundation/AVCaptureDevice/WhiteBalanceGains) structure containing device-specific RGB gain values.

## Discussion

Call this method to convert device-independent temperature and tint values to device-specific RGB white balance gain values.

You may pass any temperature and tint values and corresponding white balance gains will be produced. Note, though, that some temperature and tint combinations yield out-of-range device RGB values that will cause an exception to be thrown if passed directly to [`setWhiteBalanceModeLocked(with:completionHandler:)`](/documentation/AVFoundation/AVCaptureDevice/setWhiteBalanceModeLocked(with:completionHandler:)).  Be sure to verify that the red, green, and blue gain values are within the range of [`1.0` - [`maxWhiteBalanceGain`](/documentation/AVFoundation/AVCaptureDevice/maxWhiteBalanceGain)].

---

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)