Show / Hide Table of Contents

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.IEquatable<ColorUint>
System.IFormattable
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Fusee.Base.Common
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
public byte A
Field Value
Type Description
System.Byte

AntiqueWhite

Declaration
public static readonly ColorUint AntiqueWhite
Field Value
Type Description
ColorUint

Aqua

Declaration
public static readonly ColorUint Aqua
Field Value
Type Description
ColorUint

Aquamarine

Declaration
public static readonly ColorUint Aquamarine
Field Value
Type Description
ColorUint

Azure

Declaration
public static readonly ColorUint Azure
Field Value
Type Description
ColorUint

B

The blue component of the color.

Declaration
public byte B
Field Value
Type Description
System.Byte

Beige

Declaration
public static readonly ColorUint Beige
Field Value
Type Description
ColorUint

Bisque

Declaration
public static readonly ColorUint Bisque
Field Value
Type Description
ColorUint

Black

Declaration
public static readonly ColorUint Black
Field Value
Type Description
ColorUint

BlanchedAlmond

Declaration
public static readonly ColorUint BlanchedAlmond
Field Value
Type Description
ColorUint

Blue

Declaration
public static readonly ColorUint Blue
Field Value
Type Description
ColorUint

BlueViolet

Declaration
public static readonly ColorUint BlueViolet
Field Value
Type Description
ColorUint

Brown

Declaration
public static readonly ColorUint Brown
Field Value
Type Description
ColorUint

BurlyWood

Declaration
public static readonly ColorUint BurlyWood
Field Value
Type Description
ColorUint

CadetBlue

Declaration
public static readonly ColorUint CadetBlue
Field Value
Type Description
ColorUint

Chartreuse

Declaration
public static readonly ColorUint Chartreuse
Field Value
Type Description
ColorUint

Chocolate

Declaration
public static readonly ColorUint Chocolate
Field Value
Type Description
ColorUint

Coral

Declaration
public static readonly ColorUint Coral
Field Value
Type Description
ColorUint

CornflowerBlue

Declaration
public static readonly ColorUint CornflowerBlue
Field Value
Type Description
ColorUint

Cornsilk

Declaration
public static readonly ColorUint Cornsilk
Field Value
Type Description
ColorUint

Crimson

Declaration
public static readonly ColorUint Crimson
Field Value
Type Description
ColorUint

Cyan

Declaration
public static readonly ColorUint Cyan
Field Value
Type Description
ColorUint

DarkBlue

Declaration
public static readonly ColorUint DarkBlue
Field Value
Type Description
ColorUint

DarkCyan

Declaration
public static readonly ColorUint DarkCyan
Field Value
Type Description
ColorUint

DarkGoldenrod

Declaration
public static readonly ColorUint DarkGoldenrod
Field Value
Type Description
ColorUint

DarkGray

Declaration
public static readonly ColorUint DarkGray
Field Value
Type Description
ColorUint

DarkGreen

Declaration
public static readonly ColorUint DarkGreen
Field Value
Type Description
ColorUint

DarkKhaki

Declaration
public static readonly ColorUint DarkKhaki
Field Value
Type Description
ColorUint

DarkMagenta

Declaration
public static readonly ColorUint DarkMagenta
Field Value
Type Description
ColorUint

DarkOliveGreen

Declaration
public static readonly ColorUint DarkOliveGreen
Field Value
Type Description
ColorUint

DarkOrange

Declaration
public static readonly ColorUint DarkOrange
Field Value
Type Description
ColorUint

DarkOrchid

Declaration
public static readonly ColorUint DarkOrchid
Field Value
Type Description
ColorUint

DarkRed

Declaration
public static readonly ColorUint DarkRed
Field Value
Type Description
ColorUint

DarkSalmon

Declaration
public static readonly ColorUint DarkSalmon
Field Value
Type Description
ColorUint

DarkSeaGreen

Declaration
public static readonly ColorUint DarkSeaGreen
Field Value
Type Description
ColorUint

DarkSlateBlue

Declaration
public static readonly ColorUint DarkSlateBlue
Field Value
Type Description
ColorUint

DarkSlateGray

Declaration
public static readonly ColorUint DarkSlateGray
Field Value
Type Description
ColorUint

DarkTurquoise

Declaration
public static readonly ColorUint DarkTurquoise
Field Value
Type Description
ColorUint

DarkViolet

Declaration
public static readonly ColorUint DarkViolet
Field Value
Type Description
ColorUint

DeepPink

Declaration
public static readonly ColorUint DeepPink
Field Value
Type Description
ColorUint

DeepSkyBlue

Declaration
public static readonly ColorUint DeepSkyBlue
Field Value
Type Description
ColorUint

DimGray

Declaration
public static readonly ColorUint DimGray
Field Value
Type Description
ColorUint

DodgerBlue

Declaration
public static readonly ColorUint DodgerBlue
Field Value
Type Description
ColorUint

FireBrick

Declaration
public static readonly ColorUint FireBrick
Field Value
Type Description
ColorUint

FloralWhite

Declaration
public static readonly ColorUint FloralWhite
Field Value
Type Description
ColorUint

ForestGreen

Declaration
public static readonly ColorUint ForestGreen
Field Value
Type Description
ColorUint

Fuchsia

Declaration
public static readonly ColorUint Fuchsia
Field Value
Type Description
ColorUint

G

The green component of the color.

Declaration
public byte G
Field Value
Type Description
System.Byte

Gainsboro

Declaration
public static readonly ColorUint Gainsboro
Field Value
Type Description
ColorUint

GhostWhite

Declaration
public static readonly ColorUint GhostWhite
Field Value
Type Description
ColorUint

Gold

Declaration
public static readonly ColorUint Gold
Field Value
Type Description
ColorUint

Goldenrod

Declaration
public static readonly ColorUint Goldenrod
Field Value
Type Description
ColorUint

Gray

Declaration
public static readonly ColorUint Gray
Field Value
Type Description
ColorUint

Green

Declaration
public static readonly ColorUint Green
Field Value
Type Description
ColorUint

Greenery

Declaration
public static readonly ColorUint Greenery
Field Value
Type Description
ColorUint

GreenYellow

Declaration
public static readonly ColorUint GreenYellow
Field Value
Type Description
ColorUint

Honeydew

Declaration
public static readonly ColorUint Honeydew
Field Value
Type Description
ColorUint

HotPink

Declaration
public static readonly ColorUint HotPink
Field Value
Type Description
ColorUint

IndianRed

Declaration
public static readonly ColorUint IndianRed
Field Value
Type Description
ColorUint

Indigo

Declaration
public static readonly ColorUint Indigo
Field Value
Type Description
ColorUint

Ivory

Declaration
public static readonly ColorUint Ivory
Field Value
Type Description
ColorUint

Khaki

Declaration
public static readonly ColorUint Khaki
Field Value
Type Description
ColorUint

Lavender

Declaration
public static readonly ColorUint Lavender
Field Value
Type Description
ColorUint

LavenderBlush

Declaration
public static readonly ColorUint LavenderBlush
Field Value
Type Description
ColorUint

LawnGreen

Declaration
public static readonly ColorUint LawnGreen
Field Value
Type Description
ColorUint

LemonChiffon

Declaration
public static readonly ColorUint LemonChiffon
Field Value
Type Description
ColorUint

LightBlue

Declaration
public static readonly ColorUint LightBlue
Field Value
Type Description
ColorUint

LightCoral

Declaration
public static readonly ColorUint LightCoral
Field Value
Type Description
ColorUint

LightCyan

Declaration
public static readonly ColorUint LightCyan
Field Value
Type Description
ColorUint

LightGoldenrodYellow

Declaration
public static readonly ColorUint LightGoldenrodYellow
Field Value
Type Description
ColorUint

LightGreen

Declaration
public static readonly ColorUint LightGreen
Field Value
Type Description
ColorUint

LightGrey

Declaration
public static readonly ColorUint LightGrey
Field Value
Type Description
ColorUint

LightPink

Declaration
public static readonly ColorUint LightPink
Field Value
Type Description
ColorUint

LightSalmon

Declaration
public static readonly ColorUint LightSalmon
Field Value
Type Description
ColorUint

LightSeaGreen

Declaration
public static readonly ColorUint LightSeaGreen
Field Value
Type Description
ColorUint

LightSkyBlue

Declaration
public static readonly ColorUint LightSkyBlue
Field Value
Type Description
ColorUint

LightSlateGray

Declaration
public static readonly ColorUint LightSlateGray
Field Value
Type Description
ColorUint

LightSteelBlue

Declaration
public static readonly ColorUint LightSteelBlue
Field Value
Type Description
ColorUint

LightYellow

Declaration
public static readonly ColorUint LightYellow
Field Value
Type Description
ColorUint

Lime

Declaration
public static readonly ColorUint Lime
Field Value
Type Description
ColorUint

LimeGreen

Declaration
public static readonly ColorUint LimeGreen
Field Value
Type Description
ColorUint

Linen

Declaration
public static readonly ColorUint Linen
Field Value
Type Description
ColorUint

Magenta

Declaration
public static readonly ColorUint Magenta
Field Value
Type Description
ColorUint

Maroon

Declaration
public static readonly ColorUint Maroon
Field Value
Type Description
ColorUint

MediumAquamarine

Declaration
public static readonly ColorUint MediumAquamarine
Field Value
Type Description
ColorUint

MediumBlue

Declaration
public static readonly ColorUint MediumBlue
Field Value
Type Description
ColorUint

MediumOrchid

Declaration
public static readonly ColorUint MediumOrchid
Field Value
Type Description
ColorUint

MediumPurple

Declaration
public static readonly ColorUint MediumPurple
Field Value
Type Description
ColorUint

MediumSeaGreen

Declaration
public static readonly ColorUint MediumSeaGreen
Field Value
Type Description
ColorUint

MediumSlateBlue

Declaration
public static readonly ColorUint MediumSlateBlue
Field Value
Type Description
ColorUint

MediumSpringGreen

Declaration
public static readonly ColorUint MediumSpringGreen
Field Value
Type Description
ColorUint

MediumTurquoise

Declaration
public static readonly ColorUint MediumTurquoise
Field Value
Type Description
ColorUint

MediumVioletRed

Declaration
public static readonly ColorUint MediumVioletRed
Field Value
Type Description
ColorUint

MidnightBlue

Declaration
public static readonly ColorUint MidnightBlue
Field Value
Type Description
ColorUint

MintCream

Declaration
public static readonly ColorUint MintCream
Field Value
Type Description
ColorUint

MistyRose

Declaration
public static readonly ColorUint MistyRose
Field Value
Type Description
ColorUint

Moccasin

Declaration
public static readonly ColorUint Moccasin
Field Value
Type Description
ColorUint

NavajoWhite

Declaration
public static readonly ColorUint NavajoWhite
Field Value
Type Description
ColorUint

Navy

Declaration
public static readonly ColorUint Navy
Field Value
Type Description
ColorUint

OldLace

Declaration
public static readonly ColorUint OldLace
Field Value
Type Description
ColorUint

Olive

Declaration
public static readonly ColorUint Olive
Field Value
Type Description
ColorUint

OliveDrab

Declaration
public static readonly ColorUint OliveDrab
Field Value
Type Description
ColorUint

Orange

Declaration
public static readonly ColorUint Orange
Field Value
Type Description
ColorUint

OrangeRed

Declaration
public static readonly ColorUint OrangeRed
Field Value
Type Description
ColorUint

Orchid

Declaration
public static readonly ColorUint Orchid
Field Value
Type Description
ColorUint

PaleGoldenrod

Declaration
public static readonly ColorUint PaleGoldenrod
Field Value
Type Description
ColorUint

PaleGreen

Declaration
public static readonly ColorUint PaleGreen
Field Value
Type Description
ColorUint

PaleTurquoise

Declaration
public static readonly ColorUint PaleTurquoise
Field Value
Type Description
ColorUint

PaleVioletRed

Declaration
public static readonly ColorUint PaleVioletRed
Field Value
Type Description
ColorUint

PapayaWhip

Declaration
public static readonly ColorUint PapayaWhip
Field Value
Type Description
ColorUint

PeachPuff

Declaration
public static readonly ColorUint PeachPuff
Field Value
Type Description
ColorUint

Peru

Declaration
public static readonly ColorUint Peru
Field Value
Type Description
ColorUint

Pink

Declaration
public static readonly ColorUint Pink
Field Value
Type Description
ColorUint

Plum

Declaration
public static readonly ColorUint Plum
Field Value
Type Description
ColorUint

PowderBlue

Declaration
public static readonly ColorUint PowderBlue
Field Value
Type Description
ColorUint

Purple

Declaration
public static readonly ColorUint Purple
Field Value
Type Description
ColorUint

R

The red component of the color.

Declaration
public byte R
Field Value
Type Description
System.Byte

Red

Declaration
public static readonly ColorUint Red
Field Value
Type Description
ColorUint

RosyBrown

Declaration
public static readonly ColorUint RosyBrown
Field Value
Type Description
ColorUint

RoyalBlue

Declaration
public static readonly ColorUint RoyalBlue
Field Value
Type Description
ColorUint

SaddleBrown

Declaration
public static readonly ColorUint SaddleBrown
Field Value
Type Description
ColorUint

Salmon

Declaration
public static readonly ColorUint Salmon
Field Value
Type Description
ColorUint

SandyBrown

Declaration
public static readonly ColorUint SandyBrown
Field Value
Type Description
ColorUint

SeaGreen

Declaration
public static readonly ColorUint SeaGreen
Field Value
Type Description
ColorUint

Seashell

Declaration
public static readonly ColorUint Seashell
Field Value
Type Description
ColorUint

Sienna

Declaration
public static readonly ColorUint Sienna
Field Value
Type Description
ColorUint

Silver

Declaration
public static readonly ColorUint Silver
Field Value
Type Description
ColorUint

SkyBlue

Declaration
public static readonly ColorUint SkyBlue
Field Value
Type Description
ColorUint

SlateBlue

Declaration
public static readonly ColorUint SlateBlue
Field Value
Type Description
ColorUint

SlateGray

Declaration
public static readonly ColorUint SlateGray
Field Value
Type Description
ColorUint

Snow

Declaration
public static readonly ColorUint Snow
Field Value
Type Description
ColorUint

SpringGreen

Declaration
public static readonly ColorUint SpringGreen
Field Value
Type Description
ColorUint

SteelBlue

Declaration
public static readonly ColorUint SteelBlue
Field Value
Type Description
ColorUint

Tan

Declaration
public static readonly ColorUint Tan
Field Value
Type Description
ColorUint

Teal

Declaration
public static readonly ColorUint Teal
Field Value
Type Description
ColorUint

Thistle

Declaration
public static readonly ColorUint Thistle
Field Value
Type Description
ColorUint

Tomato

Declaration
public static readonly ColorUint Tomato
Field Value
Type Description
ColorUint

Transparent

Declaration
public static readonly ColorUint Transparent
Field Value
Type Description
ColorUint

Turquoise

Declaration
public static readonly ColorUint Turquoise
Field Value
Type Description
ColorUint

Violet

Declaration
public static readonly ColorUint Violet
Field Value
Type Description
ColorUint

Wheat

Declaration
public static readonly ColorUint Wheat
Field Value
Type Description
ColorUint

White

Declaration
public static readonly ColorUint White
Field Value
Type Description
ColorUint

WhiteSmoke

Declaration
public static readonly ColorUint WhiteSmoke
Field Value
Type Description
ColorUint

Yellow

Declaration
public static readonly ColorUint Yellow
Field Value
Type Description
ColorUint

YellowGreen

Declaration
public static readonly ColorUint YellowGreen
Field Value
Type Description
ColorUint

Zero

Declaration
public static readonly ColorUint Zero
Field Value
Type Description
ColorUint

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)

Adds two colors.

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)

Adds two colors.

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
Type Name Description
ColorUint value

The value to clamp.

ColorUint min

The minimum value.

ColorUint max

The maximum value.

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
Type Description
ColorUint

A color.

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
Type Description
ColorUint

A color.

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
Type Description
ColorUint

A color.

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
Type Description
ColorUint

A color.

GetBrightness()

Gets the brightness.

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()

Gets the hue.

Declaration
public float GetHue()
Returns
Type Description
System.Single

The Hue-Saturation-Brightness (HSB) saturation for this Fusee.Engine.ColorUint

GetSaturation()

Gets the saturation.

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.

Remarks

This method performs the linear interpolation based on the following formula.

start + (end - start) * amount
        Passing <code data-dev-comment-type="paramref" class="paramref">amount</code> a value of 0 will cause <code data-dev-comment-type="paramref" class="paramref">start</code> to be returned; a value of 1 will cause <code data-dev-comment-type="paramref" class="paramref">end</code> to be returned.

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.

Remarks

This method performs the linear interpolation based on the following formula.

start + (end - start) * amount
        Passing <code data-dev-comment-type="paramref" class="paramref">amount</code> a value of 0 will cause <code data-dev-comment-type="paramref" class="paramref">start</code> to be returned; a value of 1 will cause <code data-dev-comment-type="paramref" class="paramref">end</code> to be returned.

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)

Modulates two colors.

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)

Modulates two colors.

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)

Negates a color.

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)

Negates a color.

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)

Scales a color.

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
Type Description
ColorUint

The scaled color.

Scale(ref ColorUint, Single, out ColorUint)

Scales a color.

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)

Subtracts two colors.

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)

Subtracts two colors.

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
public byte[] ToArray()
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
public int ToBgra()
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
public string ToCss()
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
public int ToRgba()
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()

ToString(IFormatProvider)

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.

ToString(String, IFormatProvider)

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)

Adds two colors.

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)

Modulates two colors.

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)

Scales a color.

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
Type Description
ColorUint

The scaled color.

Multiply(Single, ColorUint)

Scales a color.

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
Type Description
ColorUint

The scaled color.

Subtraction(ColorUint, ColorUint)

Subtracts two colors.

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)

Negates a color.

Declaration
public static ColorUint operator -(ColorUint value)
Parameters
Type Name Description
ColorUint value

The color to negate.

Returns
Type Description
ColorUint

A negated color.

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
Generated by DocFX
GitHub Repo
Back to top