<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITraitCollection/hasDifferentColorAppearance(comparedTo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITraitCollection(im)hasDifferentColorAppearanceComparedToTraitCollection:"
  },
  "title" : "hasDifferentColorAppearance(comparedTo:)"
}
-->

# hasDifferentColorAppearance(comparedTo:)

Queries whether changing between the specified and current trait collections would affect color values.

```
func hasDifferentColorAppearance(comparedTo traitCollection: UITraitCollection?) -> Bool
```

## Parameters

`traitCollection`

A trait collection that you want to compare to the current trait collection.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the colors in the two trait collections differ, or <doc://com.apple.documentation/documentation/Swift/false> if they have the same component values.

## Discussion

Use this method to determine whether changing the traits of the current environment would also change the colors in your interface. For example, changing the [`userInterfaceStyle`](/documentation/UIKit/UITraitCollection/userInterfaceStyle) or [`accessibilityContrast`](/documentation/UIKit/UITraitCollection/accessibilityContrast) property usually changes the colors of your interface.

---

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)