Search Results for

    Show / Hide Table of Contents

    Class ColorExtentions

    Inheritance
    object
    ColorExtentions
    Namespace: TetraCreations.Core
    Assembly: cs.temp.dll.dll
    Syntax
    public static class ColorExtentions

    Fields

    HTMLColorSymbol

    Declaration
    public const string HTMLColorSymbol = "#"
    Field Value
    Type Description
    string

    Methods

    ColorizedString(Color, string)

    Returns a string formated as : <color=#COLOR_HEX>Your Text</color> .

    Declaration
    public static string ColorizedString(this Color color, string text = "■")
    Parameters
    Type Name Description
    Color color
    string text
    Returns
    Type Description
    string

    GetBrighterColor(Color, float)

    Returns a brighter color by lerping to Color.white by a certain percentage

    Declaration
    public static Color GetBrighterColor(this Color color, float brightnessPercentage = 0.5)
    Parameters
    Type Name Description
    Color color
    float brightnessPercentage
    Returns
    Type Description
    Color

    GetDarkerColor(Color, float)

    Returns a darker color by lerping to Color.black by a certain percentage

    Declaration
    public static Color GetDarkerColor(this Color color, float darknessPercentage = 0.5)
    Parameters
    Type Name Description
    Color color
    float darknessPercentage
    Returns
    Type Description
    Color

    ToHtmlStringRGB(Color, bool)

    Converts the Color to it's hexadecimal representation ("RRGGBB").

    Declaration
    public static string ToHtmlStringRGB(this Color color, bool includeSharp = true)
    Parameters
    Type Name Description
    Color color
    bool includeSharp

    True will return "#RRGGBB"

    Returns
    Type Description
    string

    ToHtmlStringRGBA(Color, bool)

    Converts the Color to it's hexadecimal representation ("RRGGBBAA").

    Declaration
    public static string ToHtmlStringRGBA(this Color color, bool includeSharp = true)
    Parameters
    Type Name Description
    Color color
    bool includeSharp

    True will return "#RRGGBBAA"

    Returns
    Type Description
    string

    With(Color, float?, float?, float?, float?)

    Returns a new Color while chaning or keeping any value from the original Color (r, g, b, a).

    Declaration
    public static Color With(this Color color, float? r = null, float? g = null, float? b = null, float? a = null)
    Parameters
    Type Name Description
    Color color
    float? r
    float? g
    float? b
    float? a
    Returns
    Type Description
    Color
    In This Article
    Back to top Tetra Creations documentation