Provides extension methods for Unity Color and Vector3 types to simplify common color transformations and formatting.
More...
|
static Color | VectorToColor (this Vector3 vector, float a=1.0f) |
| Converts a Vector3 to a Color, using optional alpha.
|
|
static Color | VectorToColor (this Vector4 vector) |
| Converts a Vector4 to a Color.
|
|
static Vector3 | ColorToVector3 (this Color color) |
| Converts a Color to a Vector3 containing only RGB components.
|
|
static Vector4 | ColorToVector4 (this Color color) |
| Converts a Color to a Vector4.
|
|
static Color | WithRed (this Color color, float r) |
| Returns a copy of the color with a new red component.
|
|
static Color | WithGreen (this Color color, float g) |
| Returns a copy of the color with a new green component.
|
|
static Color | WithBlue (this Color color, float b) |
| Returns a copy of the color with a new blue component.
|
|
static Color | WithAlpha (this Color color, float a) |
| Returns a copy of the color with a new alpha component.
|
|
static Color | WithBrightness (this Color color, float brightness) |
| Applies brightness scaling after normalizing RGB components.
|
|
static float | GetRGBMagnitude (this Color color) |
| Computes Euclidean length of RGB components.
|
|
static float | GetRGBAMagnitude (this Color color) |
| Computes Euclidean length of RGBA components.
|
|
static Color | ScaleRGB (this Color color, float scalar) |
| Scales RGB channels by a given factor.
|
|
static Color | ScaleRGBA (this Color color, float scalar) |
| Scales all RGBA channels by a given factor.
|
|
static Color | NormalizeRGB (this Color color) |
| Normalizes RGB components to unit length; output brightness is constant.
|
|
static Color | NormalizeRGBA (this Color color) |
| Normalizes all RGBA components to unit length; output brightness is constant.
|
|
static string | WrapInHTMLTagRGB (this Color color, string @string) |
| Wraps a string in a Unity color tag using RGB only.
|
|
static string | WrapInHTMLTagRGBA (this Color color, string @string) |
| Wraps a string in a Unity color tag including alpha.
|
|
Provides extension methods for Unity Color and Vector3 types to simplify common color transformations and formatting.