Table of Contents

Struct FontPaletteOverride

Namespace
SixLabors.Fonts
Assembly
SixLabors.Fonts.dll

Replaces the color of a single palette entry when a FontPalette is applied. An override whose Index lies outside the font's palette entry range is ignored.

public readonly struct FontPaletteOverride : IEquatable<FontPaletteOverride>
Implements
Inherited Members

Constructors

FontPaletteOverride(int, GlyphColor)

Initializes a new instance of the FontPaletteOverride struct.

public FontPaletteOverride(int index, GlyphColor color)

Parameters

index int

The zero-based palette entry index to replace.

color GlyphColor

The replacement color.

Properties

Color

Gets the replacement color.

public GlyphColor Color { get; }

Property Value

GlyphColor

Index

Gets the zero-based palette entry index to replace.

public int Index { get; }

Property Value

int

Methods

Equals(FontPaletteOverride)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(FontPaletteOverride other)

Parameters

other FontPaletteOverride

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(FontPaletteOverride, FontPaletteOverride)

Compares two FontPaletteOverride objects for equality.

public static bool operator ==(FontPaletteOverride left, FontPaletteOverride right)

Parameters

left FontPaletteOverride

The FontPaletteOverride on the left side of the operand.

right FontPaletteOverride

The FontPaletteOverride on the right side of the operand.

Returns

bool

True if the current left is equal to the right parameter; otherwise, false.

operator !=(FontPaletteOverride, FontPaletteOverride)

Compares two FontPaletteOverride objects for inequality.

public static bool operator !=(FontPaletteOverride left, FontPaletteOverride right)

Parameters

left FontPaletteOverride

The FontPaletteOverride on the left side of the operand.

right FontPaletteOverride

The FontPaletteOverride on the right side of the operand.

Returns

bool

True if the current left is unequal to the right parameter; otherwise, false.