---
title: NSWindow.Depth
framework: appkit
role: symbol
role_heading: Enumeration
path: appkit/nswindow/depth
---

# NSWindow.Depth

A type that represents the depth, or amount of memory, for a single pixel in a window or screen.

## Declaration

```swift
enum Depth
```

## Overview

Overview A depth of 0 indicates default depth. Don’t make window depths persistent because they aren’t the same across systems. Use the functions colorSpaceName, bitsPerPixel, and isPlanar to extract info from an NSWindowDepth value. Use NSBestDepth to compute window depths. NSBestDepth tries to accommodate all the parameters (match or better). If there are multiple matches, this function uses color space first, then bits per sample (bps), then planar, then bits per pixel (bpp) to determine the closest match. Use 0 for bpp to indicate the default, the same as the number of bits per plane: either bps or bps * numberOfColorComponents. You may use other values as hints to provide backing stores of different configurations — for instance, 8-bit color. You can also use one of the explicit bit depths defined in Explicit Window Depth Limits for the NSWindow property depthLimit.

## Topics

### Constants

- [NSWindow.Depth.onehundredtwentyeightBitRGB](appkit/nswindow/depth/onehundredtwentyeightbitrgb.md)
- [NSWindow.Depth.sixtyfourBitRGB](appkit/nswindow/depth/sixtyfourbitrgb.md)
- [NSWindow.Depth.twentyfourBitRGB](appkit/nswindow/depth/twentyfourbitrgb.md)

### Accessing Depth Details

- [availableDepths](appkit/nswindow/depth/availabledepths.md)
- [bestDepth(colorSpaceName:bitsPerSample:bitsPerPixel:isPlanar:)](appkit/nswindow/depth/bestdepth(colorspacename:bitspersample:bitsperpixel:isplanar:).md)
- [bitsPerPixel](appkit/nswindow/depth/bitsperpixel.md)
- [bitsPerSample](appkit/nswindow/depth/bitspersample.md)
- [colorSpaceName](appkit/nswindow/depth/colorspacename.md)
- [isPlanar](appkit/nswindow/depth/isplanar.md)

### Initializers

- [init(rawValue:)](appkit/nswindow/depth/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Constants

- [NSWindow.SelectionDirection](appkit/nswindow/selectiondirection.md)
- [NSWindow.ButtonType](appkit/nswindow/buttontype.md)
- [NSRunLoop—Ordering Modes for NSWindow](appkit/nsrunloop-ordering-modes-for-nsw.md)
- [NSWindow.BackingStoreType](appkit/nswindow/backingstoretype.md)
- [NSWindow.OrderingMode](appkit/nswindow/orderingmode.md)
- [NSWindow.SharingType](appkit/nswindow/sharingtype-swift.enum.md)
- [NSWindow.NumberListOptions](appkit/nswindow/numberlistoptions.md)
- [NSWindow.AnimationBehavior](appkit/nswindow/animationbehavior-swift.enum.md)
- [NSWindow.CollectionBehavior](appkit/nswindow/collectionbehavior-swift.struct.md)
- [NSWindow.OcclusionState](appkit/nswindow/occlusionstate-swift.struct.md)
- [NSWindow.TitleVisibility](appkit/nswindow/titlevisibility-swift.enum.md)
- [NSWindow.UserTabbingPreference](appkit/nswindow/usertabbingpreference-swift.enum.md)
- [NSWindow.TabbingMode](appkit/nswindow/tabbingmode-swift.enum.md)
- [Application Kit Version for Deferred Window Display Support](appkit/application-kit-version-for-deferred-window-display-support.md)
- [Application Kit Version for Custom Sheet Position](appkit/application-kit-version-for-custom-sheet-position.md)
