<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/TextureResource/Format/color(_:pixelFormat:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation15TextureResourceC6FormatV5color_05pixelE0A2E10ColorSpaceO_So08MTLPixelE0VtFZ"
  },
  "title" : "color(_:pixelFormat:)"
}
-->

# color(_:pixelFormat:)

Indicates that a texture contains color data to interpret in a specific color space.

```
static func color(_ colorSpace: TextureResource.Format.ColorSpace, pixelFormat: MTLPixelFormat) -> TextureResource.Format
```

## Discussion

The created texture uses the [`TextureResource.Semantic.color`](/documentation/RealityKit/TextureResource/Semantic-swift.enum/color) or
[`TextureResource.Semantic.hdrColor`](/documentation/RealityKit/TextureResource/Semantic-swift.enum/hdrColor) semantic.

---

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)