Color |
public struct Color3 : IEquatable<Color3>, IFormattable
The Color3 type exposes the following members.
Name | Description | |
---|---|---|
Color3(Single) | Initializes a new instance of the Color3 struct. | |
Color3(Single) | Initializes a new instance of the Color3 struct. | |
Color3(Vector3) | Initializes a new instance of the Color3 struct. | |
Color3(Int32, Format) | Initializes a new instance of the Color3 struct. | |
Color3(UInt32, Format) | Initializes a new instance of the Color3 struct. | |
Color3(Single, Single, Single) | Initializes a new instance of the Color3 struct. |
Name | Description | |
---|---|---|
Add(Color3, Color3) | Adds two colors. | |
Add(Color3, Color3, Color3) | Obsolete. Adds two colors. | |
AdjustContrast(Color3, Single) | Adjusts the contrast of a color. | |
AdjustContrast(Color3, Single, Color3) | Obsolete. Adjusts the contrast of a color. | |
AdjustSaturation(Color3, Single) | Adjusts the saturation of a color. | |
AdjustSaturation(Color3, Single, Color3) | Obsolete. Adjusts the saturation of a color. | |
Clamp(Color3, Color3, Color3) | Restricts a value to be within a specified range. | |
Clamp(Color3, Color3, Color3, Color3) | Obsolete. Restricts a value to be within a specified range. | |
ConvertRgbToHsv(Color3) | Convert color from RGB to HSV color space. Returned hue values are in range from 0 to 360 (degrees), while saturation and value are in range from 0 to 1. | |
ConvertRgbToHsv(Color3, Single, Single, Single) | Convert color from RGB to HSV color space. Returned hue values are in range from 0 to 360 (degrees), while saturation and value are in range from 0 to 1. | |
Deconstruct | Deconstruct Color3 into tuple with red, green and blue values. | |
Equals(Color3) | Determines whether the specified Color3 is equal to this instance. | |
Equals(Color3) | Determines whether the specified Color3 is equal to this instance. | |
Equals(Object) |
Determines whether the specified Object is equal to this instance.
(Overrides ValueTypeEquals(Object)) | |
FromByteRgb | Gets Color3 from red, green and blue values defined as bytes (each value in range from 0 to 255) | |
FromHsl(Double, Double, Double) | Gets Color3 from HSL (hue, saturation, lightness) | |
FromHsl(Single, Single, Single) | Gets Color3 from HSL (hue, saturation, lightness) | |
FromHsv(Double, Double, Double) | Gets Color3 from HSV (hue, saturation, value / brightness) | |
FromHsv(Single, Single, Single) | Gets Color3 from HSV (hue, saturation, value / brightness) | |
GetHashCode |
Returns a hash code for this instance.
(Overrides ValueTypeGetHashCode) | |
InterpolateHsvColor | Linearly interpolate between two colors in HSV color space. Interpolation of hue is performed in the direction of the shorter arc spanned by the start and the end color. | |
IsSame | Returns true if byte values (each color is in range from 0 to 255) of this color are the same as byte values of the other colors. | |
Lerp(Color3, Color3, Single) | Performs a linear interpolation between two colors. | |
Lerp(Color3, Color3, Single, Color3) | Obsolete. Performs a linear interpolation between two colors. | |
Max(Color3, Color3) | Returns a color containing the largest components of the specified colors. | |
Max(Color3, Color3, Color3) | Obsolete. Returns a color containing the smallest components of the specified colors. | |
Min(Color3, Color3) | Returns a color containing the smallest components of the specified colors. | |
Min(Color3, Color3, Color3) | Obsolete. Returns a color containing the smallest components of the specified colors. | |
Modulate(Color3, Color3) | Modulates two colors. | |
Modulate(Color3, Color3, Color3) | Obsolete. Modulates two colors. | |
Negate(Color3) | Negates a color. | |
Negate(Color3, Color3) | Obsolete. Negates a color. | |
Parse | Parse method returns the color that was parsed from the color text. If the text cannot be parsed a FormatException is thrown (use TryParse(String, Color3) if you do not want to get an exception). When the color text starts with hash character (#), then the color is specified as a hex value in format RRGGBB or RGB, for example #FF0000 or #F00 for red color. Otherwise the color text should be one of the color names from the known colors defined in the Colors class. The name can be in any case. | |
Premultiply(Color3, Single) | Computes the premultiplied value of the provided color. | |
Premultiply(Color3, Single, Color3) | Obsolete. Computes the premultiplied value of the provided color. | |
Saturate | Update the color values to be between 0 and 1. | |
Saturate(Color3) | Obsolete. Restricts color values to be between 0 and 1. | |
Scale(Color3, Single) | Scales a color. | |
Scale(Color3, Single, Color3) | Obsolete. Scales a color. | |
SmoothStep(Color3, Color3, Single) | Performs a cubic interpolation between two colors. | |
SmoothStep(Color3, Color3, Single, Color3) | Obsolete. Performs a cubic interpolation between two colors. | |
Subtract(Color3, Color3) | Subtracts two colors. | |
Subtract(Color3, Color3, Color3) | Obsolete. Subtracts two colors. | |
ToArgb | Converts the color into a packed integer. | |
ToArray | Creates an array containing the elements of the color. | |
ToBgr | Converts the color into a packed integer. | |
ToBgra | Converts the color into a packed integer. | |
ToHexString | Returns a string that represents a hex value of this color in format: RRGGBB, for example red color is "FF0000" | |
ToKnownColorString | If the color is one of the colors in the known Colors class, then the name of the color is returned. Otherwise a hex string with a hash ('#') prefix is returned. | |
ToRgb | Converts the color into a packed integer. | |
ToRgba | Converts the color into a packed integer. | |
ToString |
Returns a String that represents this instance.
(Overrides ValueTypeToString) | |
ToString(IFormatProvider) | Returns a String that represents this instance. | |
ToString(String) | Returns a String that represents this instance. | |
ToString(String, IFormatProvider) | Returns a String that represents this instance. | |
ToVector3 | Converts the color into a three component vector. | |
TryParse | TryParse method tries to parse the color text and set the color out parameter. When the color text starts with hash character (#), then the color is specified as a hex value in format RRGGBB or RGB, for example #FF0000 for red color. Otherwise the color text should be one of the color names from the known colors defined in the Colors class. The name can be in any case. When the color be parse, the color is set to the color out parameter and the method returns true. Otherwise color is set to Black color and the methods returns false. |
Name | Description | |
---|---|---|
Addition(Color3, Color3) | Adds two colors. | |
Equality(Color3, Color3) | Tests for equality between two objects. | |
(Color3 to Color4) | Performs an explicit conversion from Color3 to Color4. | |
(Int32 to Color3) | Performs an explicit conversion from Int32 to Color3. | |
(Color3 to Vector3) | Performs an implicit conversion from Color3 to Vector3. | |
(Vector3 to Color3) | Performs an implicit conversion from Vector3 to Color3. | |
Inequality(Color3, Color3) | Tests for inequality between two objects. | |
Multiply(Color3, Color3) | Modulates two colors. | |
Multiply(Color3, Single) | Scales a color. | |
Multiply(Single, Color3) | Scales a color. | |
Subtraction(Color3, Color3) | Subtracts two colors. | |
UnaryNegation(Color3) | Negates a color. | |
UnaryPlus(Color3) | Assert a color (return it unchanged). |
Name | Description | |
---|---|---|
Black | The Black color (0, 0, 0). | |
Blue | The blue component of the color. | |
Green | The green component of the color. | |
Red | The red component of the color. | |
White | The White color (1, 1, 1, 1). |
Name | Description | |
---|---|---|
Saturate |
Ensures that the color components are within 0 and 1 - if smaller than 0 than the value is set to 0; if bigger than 1 the value is set to 1. This is the same as saturate function in HLSL.
(Defined by Extensions) | |
Saturate |
Ensures that the color components are within 0 and 1 - if smaller than 0 than the value is set to 0; if bigger than 1 the value is set to 1. This is the same as saturate function in HLSL.
(Defined by Extensions) | |
Saturate |
Ensures that the color components are within 0 and 1 - if smaller than 0 than the value is set to 0; if bigger than 1 the value is set to 1. This is the same as saturate function in HLSL.
(Defined by Extensions) | |
ToAvaloniaColor |
Converts SharpEngine's Color3 to Avalonia color
(Defined by Extensions) | |
ToColor4 |
Converts Color3 to Color4
(Defined by Extensions) | |
ToColor4 |
Converts Color3 with alpha (or opacity) to Color4
(Defined by Extensions) | |
ToWinUIColor |
Converts SharpEngine's Color3 to WinUI color
(Defined by Extensions) | |
ToWpfColor |
Converts SharpEngine's Color3 to WPF color
(Defined by Extensions) |