<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGColorSpaceGetColorTable",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGColorSpaceGetColorTable"
  },
  "title" : "CGColorSpaceGetColorTable"
}
-->

# CGColorSpaceGetColorTable

Copies the entries in the color table of an indexed color space.

```
extern void CGColorSpaceGetColorTable(CGColorSpaceRef space, uint8_t *table);
```

## Parameters

`space`

A color space object for an indexed color space.

`table`

The array pointed to by table should be at least as large as the number of entries in the color table. On output, the array contains the table data  in the same format as that passed to [`init(indexedBaseSpace:last:colorTable:)`](/documentation/CoreGraphics/CGColorSpace/init(indexedBaseSpace:last:colorTable:)).

## Discussion

This function does nothing if the color space is not an indexed color space. To determine whether a color space is an indexed color space, call the function [`model`](/documentation/CoreGraphics/CGColorSpace/model).

---

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)