Struct ColorUint
Represents a 32-bit color (4 bytes) in the form of RGBA (in byte order: R, G, B, A).
Seen as a 32 bit unsigned integer, each color is in the form AARRGGBB - so the
most significant byte is Alpha and the least significant byte is the blue channel
Implements
System.IFormattable
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Fusee.Base.Common.dll
Syntax
public struct ColorUint : IEquatable<ColorUint>, IFormattable
Constructors
ColorUint(float3, Single)
Initializes a new instance of the Fusee.Engine.ColorUint struct.
Declaration
public ColorUint(float3 value, float alpha)
Parameters
Type |
Name |
Description |
float3 |
value |
The red, green, and blue components of the color.
|
System.Single |
alpha |
The alpha component of the color.
|
ColorUint(float4)
Initializes a new instance of the Fusee.Engine.ColorUint struct.
Declaration
public ColorUint(float4 value)
Parameters
Type |
Name |
Description |
float4 |
value |
The red, green, blue, and alpha components of the color.
|
ColorUint(Byte)
Initializes a new instance of the Fusee.Engine.ColorUint struct.
Declaration
public ColorUint(byte value)
Parameters
Type |
Name |
Description |
System.Byte |
value |
The value that will be assigned to all components.
|
ColorUint(Byte, Byte, Byte, Byte)
Initializes a new instance of the Fusee.Engine.ColorUint struct.
Declaration
public ColorUint(byte red, byte green, byte blue, byte alpha)
Parameters
Type |
Name |
Description |
System.Byte |
red |
The red component of the color.
|
System.Byte |
green |
The green component of the color.
|
System.Byte |
blue |
The blue component of the color.
|
System.Byte |
alpha |
The alpha component of the color.
|
ColorUint(Byte[])
Initializes a new instance of the Fusee.Engine.ColorUint struct.
Declaration
public ColorUint(byte[] values)
Parameters
Type |
Name |
Description |
System.Byte[] |
values |
The values to assign to the alpha, red, green, and blue components of the color. This must be an array with four elements.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown when values is null .
|
System.ArgumentOutOfRangeException |
Thrown when values contains more or less than four elements.
|
ColorUint(Byte[], Int32, Boolean)
Initializes a new instance of the Fusee.Engine.ColorUint struct.
Declaration
public ColorUint(byte[] copyFrom, int index, bool noAlpha = true)
Parameters
Type |
Name |
Description |
System.Byte[] |
copyFrom |
The array to copy from.
|
System.Int32 |
index |
The index where to start copying color data.
|
System.Boolean |
noAlpha |
if set to true do not copy any alpha value.
|
ColorUint(Int32)
Initializes a new instance of the Fusee.Engine.ColorUint struct.
Declaration
public ColorUint(int rgba)
Parameters
Type |
Name |
Description |
System.Int32 |
rgba |
A packed integer containing all four color components in RGBA order.
|
ColorUint(Single)
Initializes a new instance of the Fusee.Engine.ColorUint struct.
Declaration
public ColorUint(float value)
Parameters
Type |
Name |
Description |
System.Single |
value |
The value that will be assigned to all components.
|
ColorUint(Single, Single, Single, Single)
Initializes a new instance of the Fusee.Engine.ColorUint struct.
Declaration
public ColorUint(float red, float green, float blue, float alpha)
Parameters
Type |
Name |
Description |
System.Single |
red |
The red component of the color.
|
System.Single |
green |
The green component of the color.
|
System.Single |
blue |
The blue component of the color.
|
System.Single |
alpha |
The alpha component of the color.
|
ColorUint(Single[])
Initializes a new instance of the Fusee.Engine.ColorUint struct.
Declaration
public ColorUint(float[] values)
Parameters
Type |
Name |
Description |
System.Single[] |
values |
The values to assign to the red, green, and blue, alpha components of the color. This must be an array with four elements.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown when values is null .
|
System.ArgumentOutOfRangeException |
Thrown when values contains more or less than four elements.
|
ColorUint(UInt32)
Initializes a new instance of the Fusee.Engine.ColorUint struct.
Declaration
public ColorUint(uint rgba)
Parameters
Type |
Name |
Description |
System.UInt32 |
rgba |
A packed integer containing all four color components in RGBA order.
|
Fields
A
The alpha component of the color.
Declaration
Field Value
Type |
Description |
System.Byte |
|
AntiqueWhite
Declaration
public static readonly ColorUint AntiqueWhite
Field Value
Aqua
Declaration
public static readonly ColorUint Aqua
Field Value
Aquamarine
Declaration
public static readonly ColorUint Aquamarine
Field Value
Azure
Declaration
public static readonly ColorUint Azure
Field Value
B
The blue component of the color.
Declaration
Field Value
Type |
Description |
System.Byte |
|
Beige
Declaration
public static readonly ColorUint Beige
Field Value
Bisque
Declaration
public static readonly ColorUint Bisque
Field Value
Black
Declaration
public static readonly ColorUint Black
Field Value
BlanchedAlmond
Declaration
public static readonly ColorUint BlanchedAlmond
Field Value
Blue
Declaration
public static readonly ColorUint Blue
Field Value
BlueViolet
Declaration
public static readonly ColorUint BlueViolet
Field Value
Brown
Declaration
public static readonly ColorUint Brown
Field Value
BurlyWood
Declaration
public static readonly ColorUint BurlyWood
Field Value
CadetBlue
Declaration
public static readonly ColorUint CadetBlue
Field Value
Chartreuse
Declaration
public static readonly ColorUint Chartreuse
Field Value
Chocolate
Declaration
public static readonly ColorUint Chocolate
Field Value
Coral
Declaration
public static readonly ColorUint Coral
Field Value
CornflowerBlue
Declaration
public static readonly ColorUint CornflowerBlue
Field Value
Cornsilk
Declaration
public static readonly ColorUint Cornsilk
Field Value
Crimson
Declaration
public static readonly ColorUint Crimson
Field Value
Cyan
Declaration
public static readonly ColorUint Cyan
Field Value
DarkBlue
Declaration
public static readonly ColorUint DarkBlue
Field Value
DarkCyan
Declaration
public static readonly ColorUint DarkCyan
Field Value
DarkGoldenrod
Declaration
public static readonly ColorUint DarkGoldenrod
Field Value
DarkGray
Declaration
public static readonly ColorUint DarkGray
Field Value
DarkGreen
Declaration
public static readonly ColorUint DarkGreen
Field Value
DarkKhaki
Declaration
public static readonly ColorUint DarkKhaki
Field Value
DarkMagenta
Declaration
public static readonly ColorUint DarkMagenta
Field Value
DarkOliveGreen
Declaration
public static readonly ColorUint DarkOliveGreen
Field Value
DarkOrange
Declaration
public static readonly ColorUint DarkOrange
Field Value
DarkOrchid
Declaration
public static readonly ColorUint DarkOrchid
Field Value
DarkRed
Declaration
public static readonly ColorUint DarkRed
Field Value
DarkSalmon
Declaration
public static readonly ColorUint DarkSalmon
Field Value
DarkSeaGreen
Declaration
public static readonly ColorUint DarkSeaGreen
Field Value
DarkSlateBlue
Declaration
public static readonly ColorUint DarkSlateBlue
Field Value
DarkSlateGray
Declaration
public static readonly ColorUint DarkSlateGray
Field Value
DarkTurquoise
Declaration
public static readonly ColorUint DarkTurquoise
Field Value
DarkViolet
Declaration
public static readonly ColorUint DarkViolet
Field Value
DeepPink
Declaration
public static readonly ColorUint DeepPink
Field Value
DeepSkyBlue
Declaration
public static readonly ColorUint DeepSkyBlue
Field Value
DimGray
Declaration
public static readonly ColorUint DimGray
Field Value
DodgerBlue
Declaration
public static readonly ColorUint DodgerBlue
Field Value
FireBrick
Declaration
public static readonly ColorUint FireBrick
Field Value
FloralWhite
Declaration
public static readonly ColorUint FloralWhite
Field Value
ForestGreen
Declaration
public static readonly ColorUint ForestGreen
Field Value
Fuchsia
Declaration
public static readonly ColorUint Fuchsia
Field Value
G
The green component of the color.
Declaration
Field Value
Type |
Description |
System.Byte |
|
Gainsboro
Declaration
public static readonly ColorUint Gainsboro
Field Value
GhostWhite
Declaration
public static readonly ColorUint GhostWhite
Field Value
Gold
Declaration
public static readonly ColorUint Gold
Field Value
Goldenrod
Declaration
public static readonly ColorUint Goldenrod
Field Value
Gray
Declaration
public static readonly ColorUint Gray
Field Value
Green
Declaration
public static readonly ColorUint Green
Field Value
Greenery
Declaration
public static readonly ColorUint Greenery
Field Value
GreenYellow
Declaration
public static readonly ColorUint GreenYellow
Field Value
Honeydew
Declaration
public static readonly ColorUint Honeydew
Field Value
HotPink
Declaration
public static readonly ColorUint HotPink
Field Value
IndianRed
Declaration
public static readonly ColorUint IndianRed
Field Value
Indigo
Declaration
public static readonly ColorUint Indigo
Field Value
Ivory
Declaration
public static readonly ColorUint Ivory
Field Value
Khaki
Declaration
public static readonly ColorUint Khaki
Field Value
Lavender
Declaration
public static readonly ColorUint Lavender
Field Value
LavenderBlush
Declaration
public static readonly ColorUint LavenderBlush
Field Value
LawnGreen
Declaration
public static readonly ColorUint LawnGreen
Field Value
LemonChiffon
Declaration
public static readonly ColorUint LemonChiffon
Field Value
LightBlue
Declaration
public static readonly ColorUint LightBlue
Field Value
LightCoral
Declaration
public static readonly ColorUint LightCoral
Field Value
LightCyan
Declaration
public static readonly ColorUint LightCyan
Field Value
LightGoldenrodYellow
Declaration
public static readonly ColorUint LightGoldenrodYellow
Field Value
LightGreen
Declaration
public static readonly ColorUint LightGreen
Field Value
LightGrey
Declaration
public static readonly ColorUint LightGrey
Field Value
LightPink
Declaration
public static readonly ColorUint LightPink
Field Value
LightSalmon
Declaration
public static readonly ColorUint LightSalmon
Field Value
LightSeaGreen
Declaration
public static readonly ColorUint LightSeaGreen
Field Value
LightSkyBlue
Declaration
public static readonly ColorUint LightSkyBlue
Field Value
LightSlateGray
Declaration
public static readonly ColorUint LightSlateGray
Field Value
LightSteelBlue
Declaration
public static readonly ColorUint LightSteelBlue
Field Value
LightYellow
Declaration
public static readonly ColorUint LightYellow
Field Value
Lime
Declaration
public static readonly ColorUint Lime
Field Value
LimeGreen
Declaration
public static readonly ColorUint LimeGreen
Field Value
Linen
Declaration
public static readonly ColorUint Linen
Field Value
Magenta
Declaration
public static readonly ColorUint Magenta
Field Value
Maroon
Declaration
public static readonly ColorUint Maroon
Field Value
MediumAquamarine
Declaration
public static readonly ColorUint MediumAquamarine
Field Value
MediumBlue
Declaration
public static readonly ColorUint MediumBlue
Field Value
MediumOrchid
Declaration
public static readonly ColorUint MediumOrchid
Field Value
MediumPurple
Declaration
public static readonly ColorUint MediumPurple
Field Value
MediumSeaGreen
Declaration
public static readonly ColorUint MediumSeaGreen
Field Value
MediumSlateBlue
Declaration
public static readonly ColorUint MediumSlateBlue
Field Value
MediumSpringGreen
Declaration
public static readonly ColorUint MediumSpringGreen
Field Value
MediumTurquoise
Declaration
public static readonly ColorUint MediumTurquoise
Field Value
MediumVioletRed
Declaration
public static readonly ColorUint MediumVioletRed
Field Value
MidnightBlue
Declaration
public static readonly ColorUint MidnightBlue
Field Value
MintCream
Declaration
public static readonly ColorUint MintCream
Field Value
MistyRose
Declaration
public static readonly ColorUint MistyRose
Field Value
Moccasin
Declaration
public static readonly ColorUint Moccasin
Field Value
NavajoWhite
Declaration
public static readonly ColorUint NavajoWhite
Field Value
Navy
Declaration
public static readonly ColorUint Navy
Field Value
OldLace
Declaration
public static readonly ColorUint OldLace
Field Value
Olive
Declaration
public static readonly ColorUint Olive
Field Value
OliveDrab
Declaration
public static readonly ColorUint OliveDrab
Field Value
Orange
Declaration
public static readonly ColorUint Orange
Field Value
OrangeRed
Declaration
public static readonly ColorUint OrangeRed
Field Value
Orchid
Declaration
public static readonly ColorUint Orchid
Field Value
PaleGoldenrod
Declaration
public static readonly ColorUint PaleGoldenrod
Field Value
PaleGreen
Declaration
public static readonly ColorUint PaleGreen
Field Value
PaleTurquoise
Declaration
public static readonly ColorUint PaleTurquoise
Field Value
PaleVioletRed
Declaration
public static readonly ColorUint PaleVioletRed
Field Value
PapayaWhip
Declaration
public static readonly ColorUint PapayaWhip
Field Value
PeachPuff
Declaration
public static readonly ColorUint PeachPuff
Field Value
Peru
Declaration
public static readonly ColorUint Peru
Field Value
Pink
Declaration
public static readonly ColorUint Pink
Field Value
Plum
Declaration
public static readonly ColorUint Plum
Field Value
PowderBlue
Declaration
public static readonly ColorUint PowderBlue
Field Value
Purple
Declaration
public static readonly ColorUint Purple
Field Value
R
The red component of the color.
Declaration
Field Value
Type |
Description |
System.Byte |
|
Red
Declaration
public static readonly ColorUint Red
Field Value
RosyBrown
Declaration
public static readonly ColorUint RosyBrown
Field Value
RoyalBlue
Declaration
public static readonly ColorUint RoyalBlue
Field Value
SaddleBrown
Declaration
public static readonly ColorUint SaddleBrown
Field Value
Salmon
Declaration
public static readonly ColorUint Salmon
Field Value
SandyBrown
Declaration
public static readonly ColorUint SandyBrown
Field Value
SeaGreen
Declaration
public static readonly ColorUint SeaGreen
Field Value
Seashell
Declaration
public static readonly ColorUint Seashell
Field Value
Sienna
Declaration
public static readonly ColorUint Sienna
Field Value
Silver
Declaration
public static readonly ColorUint Silver
Field Value
SkyBlue
Declaration
public static readonly ColorUint SkyBlue
Field Value
SlateBlue
Declaration
public static readonly ColorUint SlateBlue
Field Value
SlateGray
Declaration
public static readonly ColorUint SlateGray
Field Value
Snow
Declaration
public static readonly ColorUint Snow
Field Value
SpringGreen
Declaration
public static readonly ColorUint SpringGreen
Field Value
SteelBlue
Declaration
public static readonly ColorUint SteelBlue
Field Value
Tan
Declaration
public static readonly ColorUint Tan
Field Value
Teal
Declaration
public static readonly ColorUint Teal
Field Value
Thistle
Declaration
public static readonly ColorUint Thistle
Field Value
Tomato
Declaration
public static readonly ColorUint Tomato
Field Value
Transparent
Declaration
public static readonly ColorUint Transparent
Field Value
Turquoise
Declaration
public static readonly ColorUint Turquoise
Field Value
Violet
Declaration
public static readonly ColorUint Violet
Field Value
Wheat
Declaration
public static readonly ColorUint Wheat
Field Value
White
Declaration
public static readonly ColorUint White
Field Value
WhiteSmoke
Declaration
public static readonly ColorUint WhiteSmoke
Field Value
Yellow
Declaration
public static readonly ColorUint Yellow
Field Value
YellowGreen
Declaration
public static readonly ColorUint YellowGreen
Field Value
Zero
Declaration
public static readonly ColorUint Zero
Field Value
Properties
Item[Int32]
Gets and sets the component at the specified index.
Declaration
public byte this[int index] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
The index of the component to access. Use 0 for the alpha component, 1 for the red component, 2 for the green component, and 3 for the blue component.
|
Property Value
Type |
Description |
System.Byte |
The value of the alpha, red, green, or blue component, depending on the index.
|
Exceptions
Type |
Condition |
System.ArgumentOutOfRangeException |
Thrown when the index is out of the range [0, 3].
|
Methods
Add(ColorUint, ColorUint)
Declaration
public static ColorUint Add(ColorUint left, ColorUint right)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first color to add.
|
ColorUint |
right |
The second color to add.
|
Returns
Type |
Description |
ColorUint |
The sum of the two colors.
|
Add(ref ColorUint, ref ColorUint, out ColorUint)
Declaration
public static void Add(ref ColorUint left, ref ColorUint right, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first color to add.
|
ColorUint |
right |
The second color to add.
|
ColorUint |
result |
When the method completes, completes the sum of the two colors.
|
AdjustContrast(ColorUint, Single)
Adjusts the contrast of a color.
Declaration
public static ColorUint AdjustContrast(ColorUint value, float contrast)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color whose contrast is to be adjusted.
|
System.Single |
contrast |
The amount by which to adjust the contrast.
|
Returns
Type |
Description |
ColorUint |
The adjusted color.
|
AdjustContrast(ref ColorUint, Single, out ColorUint)
Adjusts the contrast of a color.
Declaration
public static void AdjustContrast(ref ColorUint value, float contrast, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color whose contrast is to be adjusted.
|
System.Single |
contrast |
The amount by which to adjust the contrast.
|
ColorUint |
result |
When the method completes, contains the adjusted color.
|
AdjustSaturation(ColorUint, Single)
Adjusts the saturation of a color.
Declaration
public static ColorUint AdjustSaturation(ColorUint value, float saturation)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color whose saturation is to be adjusted.
|
System.Single |
saturation |
The amount by which to adjust the saturation.
|
Returns
Type |
Description |
ColorUint |
The adjusted color.
|
AdjustSaturation(ref ColorUint, Single, out ColorUint)
Adjusts the saturation of a color.
Declaration
public static void AdjustSaturation(ref ColorUint value, float saturation, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color whose saturation is to be adjusted.
|
System.Single |
saturation |
The amount by which to adjust the saturation.
|
ColorUint |
result |
When the method completes, contains the adjusted color.
|
Clamp(ColorUint, ColorUint, ColorUint)
Restricts a value to be within a specified range.
Declaration
public static ColorUint Clamp(ColorUint value, ColorUint min, ColorUint max)
Parameters
Returns
Type |
Description |
ColorUint |
The clamped value.
|
Clamp(ref ColorUint, ref ColorUint, ref ColorUint, out ColorUint)
Restricts a value to be within a specified range.
Declaration
public static void Clamp(ref ColorUint value, ref ColorUint min, ref ColorUint max, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The value to clamp.
|
ColorUint |
min |
The minimum value.
|
ColorUint |
max |
The maximum value.
|
ColorUint |
result |
When the method completes, contains the clamped value.
|
Equals(ColorUint)
Determines whether the specified Fusee.Engine.ColorUint is equal to this instance.
Declaration
public bool Equals(ColorUint other)
Parameters
Type |
Name |
Description |
ColorUint |
other |
The Fusee.Engine.ColorUint to compare with this instance.
|
Returns
Type |
Description |
System.Boolean |
true if the specified Fusee.Engine.ColorUint is equal to this instance; otherwise, false .
|
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
The System.Object to compare with this instance.
|
Returns
Type |
Description |
System.Boolean |
true if the specified System.Object is equal to this instance; otherwise, false .
|
Overrides
System.ValueType.Equals(System.Object)
FromBgra(Int32)
Converts the color from a packed BGRA integer.
Declaration
public static ColorUint FromBgra(int color)
Parameters
Type |
Name |
Description |
System.Int32 |
color |
A packed integer containing all four color components in BGRA order
|
Returns
FromBgra(UInt32)
Converts the color from a packed BGRA integer.
Declaration
public static ColorUint FromBgra(uint color)
Parameters
Type |
Name |
Description |
System.UInt32 |
color |
A packed integer containing all four color components in BGRA order
|
Returns
FromRgba(Int32)
Converts the color from a packed BGRA integer.
Declaration
public static ColorUint FromRgba(int color)
Parameters
Type |
Name |
Description |
System.Int32 |
color |
A packed integer containing all four color components in RGBA order
|
Returns
FromRgba(UInt32)
Converts the color from a packed BGRA integer.
Declaration
public static ColorUint FromRgba(uint color)
Parameters
Type |
Name |
Description |
System.UInt32 |
color |
A packed integer containing all four color components in RGBA order
|
Returns
GetBrightness()
Declaration
public float GetBrightness()
Returns
Type |
Description |
System.Single |
The Hue-Saturation-Brightness (HSB) saturation for this Fusee.Engine.ColorUint
|
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
|
Overrides
System.ValueType.GetHashCode()
GetHue()
Declaration
Returns
Type |
Description |
System.Single |
The Hue-Saturation-Brightness (HSB) saturation for this Fusee.Engine.ColorUint
|
GetSaturation()
Declaration
public float GetSaturation()
Returns
Type |
Description |
System.Single |
The Hue-Saturation-Brightness (HSB) saturation for this Fusee.Engine.ColorUint
|
Lerp(ColorUint, ColorUint, Single)
Performs a linear interpolation between two colors.
Declaration
public static ColorUint Lerp(ColorUint start, ColorUint end, float amount)
Parameters
Type |
Name |
Description |
ColorUint |
start |
Start color.
|
ColorUint |
end |
End color.
|
System.Single |
amount |
Value between 0 and 1 indicating the weight of end .
|
Returns
Type |
Description |
ColorUint |
The linear interpolation of the two colors.
|
Lerp(ref ColorUint, ref ColorUint, Single, out ColorUint)
Performs a linear interpolation between two colors.
Declaration
public static void Lerp(ref ColorUint start, ref ColorUint end, float amount, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
start |
Start color.
|
ColorUint |
end |
End color.
|
System.Single |
amount |
Value between 0 and 1 indicating the weight of end .
|
ColorUint |
result |
When the method completes, contains the linear interpolation of the two colors.
|
Max(ColorUint, ColorUint)
Returns a color containing the largest components of the specified colors.
Declaration
public static ColorUint Max(ColorUint left, ColorUint right)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first source color.
|
ColorUint |
right |
The second source color.
|
Returns
Type |
Description |
ColorUint |
A color containing the largest components of the source colors.
|
Max(ref ColorUint, ref ColorUint, out ColorUint)
Returns a color containing the smallest components of the specified colors.
Declaration
public static void Max(ref ColorUint left, ref ColorUint right, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first source color.
|
ColorUint |
right |
The second source color.
|
ColorUint |
result |
When the method completes, contains an new color composed of the largest components of the source colors.
|
Min(ColorUint, ColorUint)
Returns a color containing the smallest components of the specified colors.
Declaration
public static ColorUint Min(ColorUint left, ColorUint right)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first source color.
|
ColorUint |
right |
The second source color.
|
Returns
Type |
Description |
ColorUint |
A color containing the smallest components of the source colors.
|
Min(ref ColorUint, ref ColorUint, out ColorUint)
Returns a color containing the smallest components of the specified colors.
Declaration
public static void Min(ref ColorUint left, ref ColorUint right, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first source color.
|
ColorUint |
right |
The second source color.
|
ColorUint |
result |
When the method completes, contains an new color composed of the smallest components of the source colors.
|
Modulate(ColorUint, ColorUint)
Declaration
public static ColorUint Modulate(ColorUint left, ColorUint right)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first color to modulate.
|
ColorUint |
right |
The second color to modulate.
|
Returns
Type |
Description |
ColorUint |
The modulated color.
|
Modulate(ref ColorUint, ref ColorUint, out ColorUint)
Declaration
public static void Modulate(ref ColorUint left, ref ColorUint right, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first color to modulate.
|
ColorUint |
right |
The second color to modulate.
|
ColorUint |
result |
When the method completes, contains the modulated color.
|
Negate(ColorUint)
Declaration
public static ColorUint Negate(ColorUint value)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color to negate.
|
Returns
Type |
Description |
ColorUint |
The negated color.
|
Negate(ref ColorUint, out ColorUint)
Declaration
public static void Negate(ref ColorUint value, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color to negate.
|
ColorUint |
result |
When the method completes, contains the negated color.
|
Scale(ColorUint, Single)
Declaration
public static ColorUint Scale(ColorUint value, float scale)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color to scale.
|
System.Single |
scale |
The amount by which to scale.
|
Returns
Scale(ref ColorUint, Single, out ColorUint)
Declaration
public static void Scale(ref ColorUint value, float scale, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color to scale.
|
System.Single |
scale |
The amount by which to scale.
|
ColorUint |
result |
When the method completes, contains the scaled color.
|
SmoothStep(ColorUint, ColorUint, Single)
Performs a cubic interpolation between two colors.
Declaration
public static ColorUint SmoothStep(ColorUint start, ColorUint end, float amount)
Parameters
Type |
Name |
Description |
ColorUint |
start |
Start color.
|
ColorUint |
end |
End color.
|
System.Single |
amount |
Value between 0 and 1 indicating the weight of end .
|
Returns
Type |
Description |
ColorUint |
The cubic interpolation of the two colors.
|
SmoothStep(ref ColorUint, ref ColorUint, Single, out ColorUint)
Performs a cubic interpolation between two colors.
Declaration
public static void SmoothStep(ref ColorUint start, ref ColorUint end, float amount, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
start |
Start color.
|
ColorUint |
end |
End color.
|
System.Single |
amount |
Value between 0 and 1 indicating the weight of end .
|
ColorUint |
result |
When the method completes, contains the cubic interpolation of the two colors.
|
Subtract(ColorUint, ColorUint)
Declaration
public static ColorUint Subtract(ColorUint left, ColorUint right)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first color to subtract.
|
ColorUint |
right |
The second color to subtract
|
Returns
Type |
Description |
ColorUint |
The difference of the two colors.
|
Subtract(ref ColorUint, ref ColorUint, out ColorUint)
Declaration
public static void Subtract(ref ColorUint left, ref ColorUint right, out ColorUint result)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first color to subtract.
|
ColorUint |
right |
The second color to subtract.
|
ColorUint |
result |
WHen the method completes, contains the difference of the two colors.
|
ToArray()
Creates an array containing the elements of the color.
Declaration
Returns
Type |
Description |
System.Byte[] |
A four-element array containing the components of the color in RGBA order.
|
ToBgra()
Converts the color into a packed integer.
Declaration
Returns
Type |
Description |
System.Int32 |
A packed integer containing all four color components.
|
ToCss()
Converts the color to a string capable of being used in html/css declarations, like #FF0000 for red or #0000FF for blue.
Declaration
Returns
Type |
Description |
System.String |
A seven characters string (# followed by two hex digits for each color channel, red, green and blue).
|
Tofloat3(ColorUint)
Converts the Uint color into a three component vector.
Declaration
public static float3 Tofloat3(ColorUint col)
Parameters
Type |
Name |
Description |
ColorUint |
col |
The color to convert.
|
Returns
Type |
Description |
float3 |
A three component vector containing the red, green, and blue components of the color.
|
Tofloat4(ColorUint)
Converts the Uint color into a four component vector.
Declaration
public static float4 Tofloat4(ColorUint col)
Parameters
Type |
Name |
Description |
ColorUint |
col |
The color to convert.
|
Returns
Type |
Description |
float4 |
A four component vector containing all four color components.
|
ToRgba()
Converts the color into a packed integer.
Declaration
Returns
Type |
Description |
System.Int32 |
A packed integer containing all four color components.
|
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
A System.String that represents this instance.
|
Overrides
System.ValueType.ToString()
Returns a System.String that represents this instance.
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
formatProvider |
The format provider.
|
Returns
Type |
Description |
System.String |
A System.String that represents this instance.
|
ToString(String)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format)
Parameters
Type |
Name |
Description |
System.String |
format |
The format.
|
Returns
Type |
Description |
System.String |
A System.String that represents this instance.
|
Returns a System.String that represents this instance.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type |
Name |
Description |
System.String |
format |
The format.
|
System.IFormatProvider |
formatProvider |
The format provider.
|
Returns
Type |
Description |
System.String |
A System.String that represents this instance.
|
Operators
Addition(ColorUint, ColorUint)
Declaration
public static ColorUint operator +(ColorUint left, ColorUint right)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first color to add.
|
ColorUint |
right |
The second color to add.
|
Returns
Type |
Description |
ColorUint |
The sum of the two colors.
|
Equality(ColorUint, ColorUint)
Tests for equality between two objects.
Declaration
public static bool operator ==(ColorUint left, ColorUint right)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first value to compare.
|
ColorUint |
right |
The second value to compare.
|
Returns
Type |
Description |
System.Boolean |
true if left has the same value as right ; otherwise, false .
|
Explicit(ColorUint to float3)
Performs an explicit conversion from Fusee.Engine.ColorUint to Fusee.Math.float3.
Declaration
public static explicit operator float3(ColorUint value)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color value. It is expected to be in SRgb color space - will be transformed to linear space in order to perform the lighting calculation correctly.
|
Returns
Type |
Description |
float3 |
The result of the conversion.
|
Explicit(ColorUint to float4)
Performs an explicit conversion from Fusee.Engine.ColorUint to Fusee.Math.float4.
Declaration
public static explicit operator float4(ColorUint value)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color value. It is expected to be in SRgb color space - will be transformed to linear space in order to perform the lighting calculation correctly.
|
Returns
Type |
Description |
float4 |
The result of the conversion.
|
Explicit(ColorUint to Int32)
Performs an explicit conversion from System.Int32 to Fusee.Engine.ColorUint.
Declaration
public static explicit operator int (ColorUint value)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The value.
|
Returns
Type |
Description |
System.Int32 |
The result of the conversion.
|
Explicit(ColorUint to UInt32)
Performs an explicit conversion from System.Int32 to Fusee.Engine.ColorUint.
Declaration
public static explicit operator uint (ColorUint value)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The value.
|
Returns
Type |
Description |
System.UInt32 |
The result of the conversion.
|
Explicit(float3 to ColorUint)
Performs an explicit conversion from Fusee.Math.float3 to Fusee.Engine.ColorUint.
Declaration
public static explicit operator ColorUint(float3 value)
Parameters
Type |
Name |
Description |
float3 |
value |
The color value.
|
Returns
Type |
Description |
ColorUint |
The result of the conversion.
|
Explicit(float4 to ColorUint)
Performs an explicit conversion from Fusee.Math.float4 to Fusee.Engine.ColorUint.
Declaration
public static explicit operator ColorUint(float4 value)
Parameters
Type |
Name |
Description |
float4 |
value |
The color value.
|
Returns
Type |
Description |
ColorUint |
The result of the conversion.
|
Explicit(Int32 to ColorUint)
Performs an explicit conversion from System.Int32 to Fusee.Engine.ColorUint.
Declaration
public static explicit operator ColorUint(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
The value.
|
Returns
Type |
Description |
ColorUint |
The result of the conversion.
|
Explicit(UInt32 to ColorUint)
Performs an explicit conversion from System.Int32 to Fusee.Engine.ColorUint.
Declaration
public static explicit operator ColorUint(uint value)
Parameters
Type |
Name |
Description |
System.UInt32 |
value |
The value.
|
Returns
Type |
Description |
ColorUint |
The result of the conversion.
|
Inequality(ColorUint, ColorUint)
Tests for inequality between two objects.
Declaration
public static bool operator !=(ColorUint left, ColorUint right)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first value to compare.
|
ColorUint |
right |
The second value to compare.
|
Returns
Type |
Description |
System.Boolean |
true if left has a different value than right ; otherwise, false .
|
Multiply(ColorUint, ColorUint)
Declaration
public static ColorUint operator *(ColorUint left, ColorUint right)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first color to modulate.
|
ColorUint |
right |
The second color to modulate.
|
Returns
Type |
Description |
ColorUint |
The modulated color.
|
Multiply(ColorUint, Single)
Declaration
public static ColorUint operator *(ColorUint value, float scale)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The factor by which to scale the color.
|
System.Single |
scale |
The color to scale.
|
Returns
Multiply(Single, ColorUint)
Declaration
public static ColorUint operator *(float scale, ColorUint value)
Parameters
Type |
Name |
Description |
System.Single |
scale |
The factor by which to scale the color.
|
ColorUint |
value |
The color to scale.
|
Returns
Subtraction(ColorUint, ColorUint)
Declaration
public static ColorUint operator -(ColorUint left, ColorUint right)
Parameters
Type |
Name |
Description |
ColorUint |
left |
The first color to subtract.
|
ColorUint |
right |
The second color to subtract.
|
Returns
Type |
Description |
ColorUint |
The difference of the two colors.
|
UnaryNegation(ColorUint)
Declaration
public static ColorUint operator -(ColorUint value)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color to negate.
|
Returns
UnaryPlus(ColorUint)
Assert a color (return it unchanged).
Declaration
public static ColorUint operator +(ColorUint value)
Parameters
Type |
Name |
Description |
ColorUint |
value |
The color to assert (unchanged).
|
Returns
Type |
Description |
ColorUint |
The asserted (unchanged) color.
|
Implements
System.IEquatable<T>
System.IFormattable