<?xml version="1.0"?>
<page id="Gimp.Palette.get_colormap"
      type="topic"
      style="method"
      xmlns="http://projectmallard.org/1.0/"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/1.0/ui/">
  <info>
    <link xref="Gimp.Palette" group="method" type="guide"/>
    <api:function>
      <api:returns>
        <api:type>[guint8]</api:type>
      </api:returns>
      <api:name>gimp_palette_get_colormap</api:name>
      <api:arg>
        <api:type>Gimp.Palette</api:type>
        <api:name>self</api:name>
      </api:arg>
      <api:arg>
        <api:type>Babl.Object</api:type>
        <api:name>format</api:name>
      </api:arg>
      <api:arg>
        <api:type>int</api:type>
        <api:name>num_colors</api:name>
      </api:arg>
      <api:arg>
        <api:type>gsize</api:type>
        <api:name>num_bytes</api:name>
      </api:arg>
    </api:function>
  </info>
  <title>Gimp.Palette.get_colormap</title>
  <synopsis><code mime="text/x-python">
@accepts(Gimp.Palette, Babl.Object, int, gsize)
@returns([guint8])
def get_colormap(self, format, num_colors, num_bytes):
    # Python wrapper for gimp_palette_get_colormap()
  </code></synopsis>
  <p>This procedure returns a palette's colormap as an array of bytes with
all colors converted to a given Babl <code>format</code>.</p>  <p>The byte-size of the returned colormap depends on the number of
colors and on the bytes-per-pixel size of <code>format</code>. E.g. that the
following equality is ensured:</p>  <p>```C
num_bytes == num_colors * babl_format_get_bytes_per_pixel (format)
```</p>  <p>Therefore <code>num_colors</code> and <code>num_bytes</code> are kinda redundant since both
indicate the size of the return value in a different way. You may
both set them to <code>None</code> but not at the same time.</p>
  <p>Since 3.0</p>
<terms>
<item>
<title><code>self</code></title>
  <p>The palette.</p>
</item>
<item>
<title><code>format</code></title>
  <p>The desired color format.</p>
</item>
<item>
<title><code>num_colors</code></title>
  <p>The number of colors in the palette.</p>
</item>
<item>
<title><code>num_bytes</code></title>
  <p>The byte-size of the returned value.</p>
</item>
<item>
<title><code>Returns</code></title>
{formatter.format(node, node.retval.doc)}
</item>
</terms>

</page>
