Table of Contents

Struct Badge

Namespace
Exiled.API.Features
Assembly
Exiled.API.dll

Represents an in-game badge.

public struct Badge
Inherited Members
Extension Methods

Constructors

Badge(string, string, bool)

Initializes a new instance of the Badge struct.

public Badge(string text, string color, bool isGlobal = false)

Parameters

text string

The badge text.

color string

The badge color.

isGlobal bool

Indicates whether the badge is global.

Properties

Color

Gets the badge color.

public readonly string Color { get; }

Property Value

string

IsGlobal

Gets a value indicating whether the badge is global.

public readonly bool IsGlobal { get; }

Property Value

bool

Text

Gets the badge text.

public readonly string Text { get; }

Property Value

string

Methods

GetHexColor(PlayerInfoColorTypes)

Gets the hex color code of the provided Misc.PlayerInfoColorTypes.

public static string GetHexColor(Misc.PlayerInfoColorTypes colorType)

Parameters

colorType Misc.PlayerInfoColorTypes

The Misc.PlayerInfoColorTypes to get the hex color code of.

Returns

string

The hex color code, including the #.

IsValidColor(string, out PlayerInfoColorTypes?)

Gets whether the provided hex color code can be used in badges.

public static bool IsValidColor(string hex, out Misc.PlayerInfoColorTypes? colorType)

Parameters

hex string

The hex color code, including the #.

colorType Misc.PlayerInfoColorTypes?

If the method returns true, this will be an enum representing the hex code. If the method returns false, this will be null.

Returns

bool

Whether the provided hex color code can be used in badges.

ToString()

Returns the Badge in a human-readable format.

public override string ToString()

Returns

string

A string containing Badge-related data.