MW UNITY NAMESPACE








































public static class

Colour


Colour conversions.



public static Color

Colour255 (Vector3 Colour)

Summary:

The corresponding colour in RGA using Vector3.

Params:

Colour:

        The RGB/XYZ channel values, respectively.



public static Color

Colour255 (int R, int G, int B)

Summary:

The corresponding colour from 0 - 255 in RGB.

Params:

R:

        The red value.

G:

        The green value.

B:

        The blue value.



public static Color

Colour255 (float R, float G, float B)

Summary:

The corresponding colour from 0 - 255 in RGB.

Params:

R:

        The red value.

G:

        The green value.

B:

        The blue value.



public static Color

Colour255 (Vector4 ColourWithAlpha)

Summary:

The corresponding colour in RGBA using Vector4.

Params:

ColourWithAlpha:

        The RGBA/XYZW channel values, respectively.



public static Color

Colour255 (int R, int G, int B, int A)

Summary:

The corresponding colour from 0 - 255 in RGBA.

Params:

R:

        The red value.

G:

        The green value.

B:

        The blue value.

A:

        The alpha value.



public static Color

Colour255 (float R, float G, float B, float A)

Summary:

The corresponding colour from 0 - 255 in RGBA.

Params:

R:

        The red value.

G:

        The green value.

B:

        The blue value.

A:

        The alpha value.



public static Color

ColourHex (string Hex)

Summary:

Converts a hexadecimal to its corresponding colour.

Params:

Hex:

        The hexadecimal in the format: "#RRGGBB"; where '#' denotes a hexadecimal, 'RR' denotes the Red colour channel, 'GG' denotes the Green colour channel and 'BB' denotes the Blue colour channel.



public static Color

ColourHex (string Hex, float Alpha)

Summary:

The corresponding hexadecimal and alpha colour.

Params:

Hex:

        The hexadecimal in the format: "#RRGGBB"; where '#' denotes a hexadecimal, 'RR' denotes the Red colour channel, 'GG' denotes the Green colour channel and 'BB' denotes the Blue colour channel.

Alpha:

        The float alpha.



public static Color

ColourHex (string Hex, string Alpha)

Summary:

The corresponding hexadecimal colour and hexadecimal alpha.

Params:

Hex:

        The hexadecimal in the format: "#RRGGBB"; where '#' denotes a hexadecimal, 'RR' denotes the Red colour channel, 'GG' denotes the Green colour channel and 'BB' denotes the Blue colour channel.

Alpha:

        The hexadecimal in the format: "#AA"; where '#' denotes a hexadecimal and 'AA' denotes the Alpha channel.



public static MVector

Get255RGB (Color Colour)

Summary:

Converts a Colour to its RGB values as an MVector.

Params:

Colour:

        The colour to split.

Returns:

An MVector where X = R, Y = G, and Z = B in 255 RGB format.



public static Vector4

Get255RGBA (Color Colour)

Summary:

Converts a Colour to its RGBA values as a Vector4.

Params:

Colour:

        The colour to split.

Returns:

A Vector4 where x = R, y = G, z = B, and w = A in 255 RGBA format.



public static string

RGBToHex (Byte R, Byte G, Byte B)

Summary:

Converts RGB bytes to a Hex string.

Remarks:

Alpha is always 255.

Params:

R:

        The Red channel.

G:

        The Green channel.

B:

        The Blue channel.

Returns:

A string in the format "#FFFFFF" of the representative colour.