<!--
{
  "availability" : [
    "macOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CompositorServices",
  "identifier" : "/documentation/CompositorServices/cp_drawable_get_color_texture",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Compositor Services"
    ],
    "preciseIdentifier" : "c:@F@cp_drawable_get_color_texture"
  },
  "title" : "cp_drawable_get_color_texture"
}
-->

# cp_drawable_get_color_texture

Returns the color texture at the specified index in the drawable.

```
id<MTLTexture>cp_drawable_get_color_texture(cp_drawable_t drawable, size_t index);
```

## Parameters

`drawable`

The drawable for a frame.

`index`

The index of the color texture you want. The index must be greater than or equal to `0` and less than the value that [`cp_drawable_get_texture_count`](/documentation/CompositorServices/cp_drawable_get_texture_count) returns.

## Return Value

The Metal color texture at the specified index.

## Discussion

Use the returned texture in your render pipeline to store the pixels you want to appear. The layer’s texture topology determines the total number of textures, and the layout and content for each texture. Use the drawable’s views to map your content into specific portions of the textures.

---

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)