<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSColorWell",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSColorWell"
  },
  "title" : "NSColorWell"
}
-->

# NSColorWell

A control that displays a color value and lets the user change that color value.

```
class NSColorWell
```

## Overview

An [`NSColorWell`](/documentation/AppKit/NSColorWell) object lets people select colors from your interface. Incorporate this type of control if your app supports custom color selection. For example, a drawing app might include a color well to let someone choose the color to use when drawing. A color well control displays the currently selected color, and interactions with the color well display interfaces for selecting new colors.

When you create a color well programmatically or in Interface Builder, specify the appearance and interaction style you want. The color well supports color selection using a color picker popover or the system [`NSColorPanel`](/documentation/AppKit/NSColorPanel) object. When someone selects a new color in one of these interfaces, the color well updates its selected color to match. You can also provide your own color selection process using a custom action and update the color yourself.

## Topics

### Creating a color well

[`+  colorWellWithStyle:`](/documentation/AppKit/NSColorWell/init(style:))

Creates a color well that adopts the specified appearance style.

### Managing the selected color

[`color`](/documentation/AppKit/NSColorWell/color)

The currently selected color for the color well.

[`-  takeColorFrom:`](/documentation/AppKit/NSColorWell/takeColorFrom(_:))

Changes the currently selected color to the color of the specified object.

[`supportsAlpha`](/documentation/AppKit/NSColorWell/supportsAlpha)

A Boolean value that determines whether the color picker supports alpha values.

### Supporting high dynamic range (HDR) colors

[`maximumLinearExposure`](/documentation/AppKit/NSColorWell/maximumLinearExposure)

The maximum linear exposure a color in this color well can be set to. Defaults to 1 and ignores any value less than 1. If set to a value >= 2, the color picked for this well may have a linear exposure applied to it.

### Configuring the appearance

[`colorWellStyle`](/documentation/AppKit/NSColorWell/colorWellStyle)

The appearance and interaction style to apply to the color well.

[`Style`](/documentation/AppKit/NSColorWell/Style)

Constants that specify the appearance and interaction modes for a color well.

[`image`](/documentation/AppKit/NSColorWell/image)

The image to display on the button portion of a color well that adopts the expanded style.

[`bordered`](/documentation/AppKit/NSColorWell/isBordered)

A Boolean value that determines whether the color well has a border.

### Activating and deactivating color wells

[`-  activate:`](/documentation/AppKit/NSColorWell/activate(_:))

Activates the color well, displays the color panel, and synchronizes the two UI elements.

[`active`](/documentation/AppKit/NSColorWell/isActive)

A Boolean value that indicates whether the color well is currently active.

[`-  deactivate`](/documentation/AppKit/NSColorWell/deactivate())

Deactivates the color well.

### Drawing color wells

[`-  drawWellInside:`](/documentation/AppKit/NSColorWell/drawWell(inside:))

Draws the area inside the color well at the specified location without drawing borders.

### Customizing the color selection behavior

[`pulldownAction`](/documentation/AppKit/NSColorWell/pulldownAction)

The action to perform when someone clicks in the color area of the color well.

[`pulldownTarget`](/documentation/AppKit/NSColorWell/pulldownTarget)

The target object that defines the action you want to perform when someone interacts with the color well.

## Relationships

### Conforms To

[`NSAppearanceCustomization`](/documentation/AppKit/NSAppearanceCustomization)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSAccessibilityElementProtocol`](/documentation/AppKit/NSAccessibilityElementProtocol)

[`NSStandardKeyBindingResponding`](/documentation/AppKit/NSStandardKeyBindingResponding)

[`NSAnimatablePropertyContainer`](/documentation/AppKit/NSAnimatablePropertyContainer)

[`NSDraggingDestination`](/documentation/AppKit/NSDraggingDestination)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSUserActivityRestoring`](/documentation/AppKit/NSUserActivityRestoring)

[`NSAccessibilityProtocol`](/documentation/AppKit/NSAccessibilityProtocol)

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Sendable`](/documentation/Swift/Sendable)

### Inherits From

[`NSControl`](/documentation/AppKit/NSControl)

---

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)