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
Methods
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
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
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
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
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