get_colors


Description:

public static uint get_colors (Face face, uint palette_index, uint start_offset, out Color[]? colors)

Fetches a list of the colors in a color palette.

After calling this function, colors will be filled with the palette colors. If colors is NULL, the function will just return the number of total colors without storing any actual colors; this can be used for allocating a buffer of suitable size before calling get_colors a second time.

The RGBA values in the palette are unpremultiplied. See the OpenType spec CPAL section for details.

Parameters:

face

Face to work upon

palette_index

the index of the color palette to query

start_offset

offset of the first color to retrieve

colors

The array of Color records found

color_count

Input = the maximum number of colors to return; Output = the actual number of colors returned (may be zero)

Returns:

the total number of colors in the palette