Class FontPalette
Selects the CPAL color palette used to resolve COLR glyph colors and optionally replaces individual palette entries.
A palette index outside the range defined by the font selects the default palette (index 0), and overrides still
apply, matching the CSS font-palette behavior. Overrides apply in order, so a later override of the same
entry replaces an earlier one, and overrides whose entry index lies outside the font's palette entry range are ignored.
public sealed class FontPalette : IEquatable<FontPalette>
- Inheritance
-
FontPalette
- Implements
- Inherited Members
Constructors
FontPalette(int)
Initializes a new instance of the FontPalette class.
public FontPalette(int index)
Parameters
indexintThe zero-based palette index within the font's CPAL table.
FontPalette(int, IReadOnlyList<FontPaletteOverride>)
Initializes a new instance of the FontPalette class.
public FontPalette(int index, IReadOnlyList<FontPaletteOverride> overrides)
Parameters
indexintThe zero-based palette index within the font's CPAL table.
overridesIReadOnlyList<FontPaletteOverride>The override colors to apply, in order, on top of the selected palette.
Properties
Index
Gets the zero-based palette index within the font's CPAL table.
public int Index { get; }
Property Value
Overrides
Gets the override colors applied, in order, on top of the selected palette.
public IReadOnlyList<FontPaletteOverride> Overrides { get; }
Property Value
Methods
Equals(FontPalette?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(FontPalette? other)
Parameters
otherFontPaletteAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.