IDWritePaintReader::SetCustomColorPalette method (dwrite_3.h)

Sets a custom color palette with client-defined palette entries, instead of using a font-defined color palette. Changing the color palette can affect the appearance of a glyph if its definition references colors in the color palette. If that's the case, then the SetCurrentGlyph method returns the DWRITE_PAINT_ATTRIBUTES_USES_PALETTE flag via the glyphAttributes output parameter.

Syntax

HRESULT SetCustomColorPalette(
  DWRITE_COLOR_F const *paletteEntries,
  UINT32               paletteEntryCount
);

Parameters

paletteEntries

Type: _In_reads_(paletteEntryCount) DWRITE_COLOR_F const *

Array of palette entries for the client-defined color palette.

paletteEntryCount

Type: UINT32

Size of the paletteEntries array. This must equal the font's palette entry count as returned by IDWriteFontFace2::GetPaletteEntryCount.

Return value

A standard HRESULT error code.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1809 (with Windows App SDK 1.2 or later)
Header dwrite_3.h