HtmlGradient
Class HtmlGradient
Namespace: SwiftlyS2.Shared
Assembly: SwiftlyS2.CS2.dll
Provides utility methods for generating HTML text with gradient color effects.
public static class HtmlGradientInheritance
Inherited Members
- object.Equals(object?)
- object.Equals(object?, object?)
- object.GetHashCode()
- object.GetType()
- object.MemberwiseClone()
- object.ReferenceEquals(object?, object?)
- object.ToString()
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
- text string — The plain text to apply gradient to. Must not contain any HTML tags.
- startColor string — The starting color in hex format (e.g., "#FF0000").
- endColor string — The ending color in hex format (e.g., "#0000FF").
Returns
- string — 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
- text string — The plain text to apply gradient to. Must not contain any HTML tags.
- colors string[] — Array of color stops in hex format (e.g., "#FF0000", "#00FF00", "#0000FF").
Returns
- string — 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
- text string — The plain text to apply gradient to. Must not contain any HTML tags.
- startColor Color — The starting SwiftlyS2 native color.
- endColor Color — The ending SwiftlyS2 native color.
Returns
- string — 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
- text string — The plain text to apply gradient to. Must not contain any HTML tags.
- startColor Color — The starting System.Drawing color.
- endColor Color — The ending System.Drawing color.
Returns
- string — 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
- text string — The plain text to apply gradient to. Must not contain any HTML tags.
- colors Color[] — Array of SwiftlyS2 native color stops.
Returns
- string — 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
- text string — The plain text to apply gradient to. Must not contain any HTML tags.
- colors Color[] — Array of System.Drawing color stops.
Returns
- string — HTML string with each character wrapped in a colored font tag.