harfbuzzjs
    Preparing search index...

    Type Alias PaintColorFunc

    PaintColorFunc: (
        isForeground: boolean,
        color: Color,
        paintData: unknown,
        userData: unknown,
    ) => void

    A callback to paint a color everywhere within the current clip.

    When isForeground is true, this color originates from the foreground-color sentinel in the font's color data. The color parameter still carries a fully resolved RGBA value (with any paint-tree alpha already applied), so backends that do not need to distinguish the foreground can simply use color directly.

    Backends that defer foreground resolution (e.g. to honor a CSS currentColor or a runtime uniform) should substitute their own foreground RGB when isForeground is true, but must combine the alpha from color with their foreground alpha, since it encodes additional modulation from the paint tree. For this mode to work correctly, the caller should pass a fully-opaque foreground color to Font.paintGlyph, so that the alpha in color reflects only the paint-tree contribution.

    Type Declaration

      • (
            isForeground: boolean,
            color: Color,
            paintData: unknown,
            userData: unknown,
        ): void
      • Parameters

        • isForeground: boolean

          whether the color is the foreground

        • color: Color

          the color to use, unpremultiplied

        • paintData: unknown

          the data accompanying the paint functions in Font.paintGlyph

        • userData: unknown

          the user data pointer passed to PaintFuncs.setColorFunc

        Returns void