harfbuzzjs
    Preparing search index...

    Type Alias PaintCustomPaletteColorFunc

    PaintCustomPaletteColorFunc: (
        colorIndex: number,
        paintData: unknown,
        userData: unknown,
    ) => Color | undefined

    A callback to fetch a custom palette override color for colorIndex.

    Custom palette colors override colors from the font's selected color palette. It is not necessary to override all palette entries; return undefined for entries that should be taken from the font palette.

    This function might be called multiple times, but the custom palette is expected to remain unchanged for the duration of one Font.paintGlyph call.

    Type Declaration

      • (colorIndex: number, paintData: unknown, userData: unknown): Color | undefined
      • Parameters

        Returns Color | undefined

        the custom color, or undefined to use the font palette.