swiftlys2/docs/api/ai/
API Reference Shared

HtmlGradient

Class
Namespace: SwiftlyS2.Shared · Assembly: SwiftlyS2.CS2.dll
public static class HtmlGradient
Inherits object

Provides utility methods for generating HTML text with gradient color effects.

View source

Methods

GenerateGradientText(string, string, string)

Generates gradient colored text by interpolating between two colors.

public static string GenerateGradientText(string text, string startColor, string endColor)
Parameters
  • textstringThe plain text to apply gradient to. Must not contain any HTML tags.
  • startColorstringThe starting color in hex format (e.g., "#FF0000").
  • endColorstringThe ending color in hex format (e.g., "#0000FF").
Returns
HTML string with each character wrapped in a colored font tag.

GenerateGradientText(string, params string[])

Generates gradient colored text by interpolating across multiple color stops.

public static string GenerateGradientText(string text, params string[] colors)
Parameters
  • textstringThe plain text to apply gradient to. Must not contain any HTML tags.
  • colorsstring[]Array of color stops in hex format (e.g., "#FF0000", "#00FF00", "#0000FF").
Returns
HTML string with each character wrapped in a colored font tag.

GenerateGradientText(string, Color, Color)

Generates gradient colored text by interpolating between two SwiftlyS2 native colors.

public static string GenerateGradientText(string text, Color startColor, Color endColor)
Parameters
  • textstringThe plain text to apply gradient to. Must not contain any HTML tags.
  • startColorColorThe starting SwiftlyS2 native color.
  • endColorColorThe ending SwiftlyS2 native color.
Returns
HTML string with each character wrapped in a colored font tag.

GenerateGradientText(string, Color, Color)

Generates gradient colored text by interpolating between two System.Drawing colors.

public static string GenerateGradientText(string text, Color startColor, Color endColor)
Parameters
  • textstringThe plain text to apply gradient to. Must not contain any HTML tags.
  • startColorColorThe starting System.Drawing color.
  • endColorColorThe ending System.Drawing color.
Returns
HTML string with each character wrapped in a colored font tag.

GenerateGradientText(string, params Color[])

Generates gradient colored text by interpolating across multiple SwiftlyS2 native color stops.

public static string GenerateGradientText(string text, params Color[] colors)
Parameters
  • textstringThe plain text to apply gradient to. Must not contain any HTML tags.
  • colorsColor[]Array of SwiftlyS2 native color stops.
Returns
HTML string with each character wrapped in a colored font tag.

GenerateGradientText(string, params Color[])

Generates gradient colored text by interpolating across multiple System.Drawing color stops.

public static string GenerateGradientText(string text, params Color[] colors)
Parameters
  • textstringThe plain text to apply gradient to. Must not contain any HTML tags.
  • colorsColor[]Array of System.Drawing color stops.
Returns
HTML string with each character wrapped in a colored font tag.