Click or drag to resize
Ab4d.SharpEngine logo

Color3 Methods

The Color3 type exposes the following members.

Methods
 NameDescription
Public methodStatic memberAdd(Color3, Color3) Adds two colors.
Public methodStatic memberAdd(Color3, Color3, Color3)Obsolete.
Adds two colors.
Public methodStatic memberAdjustContrast(Color3, Single) Adjusts the contrast of a color.
Public methodStatic memberAdjustContrast(Color3, Single, Color3)Obsolete.
Adjusts the contrast of a color.
Public methodStatic memberAdjustSaturation(Color3, Single) Adjusts the saturation of a color.
Public methodStatic memberAdjustSaturation(Color3, Single, Color3)Obsolete.
Adjusts the saturation of a color.
Public methodStatic memberClamp(Color3, Color3, Color3) Restricts a value to be within a specified range.
Public methodStatic memberClamp(Color3, Color3, Color3, Color3)Obsolete.
Restricts a value to be within a specified range.
Public methodStatic memberConvertRgbToHsv(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.
Public methodStatic memberConvertRgbToHsv(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.
Public methodDeconstruct Deconstruct Color3 into tuple with red, green and blue values.
Public methodEquals(Color3) Determines whether the specified Color3 is equal to this instance.
Public methodEquals(Color3) Determines whether the specified Color3 is equal to this instance.
Public methodEquals(Object) Determines whether the specified Object is equal to this instance.
(Overrides ValueTypeEquals(Object))
Public methodStatic memberFromByteRgb Gets Color3 from red, green and blue values defined as bytes (each value in range from 0 to 255)
Public methodStatic memberFromHsl(Double, Double, Double) Gets Color3 from HSL (hue, saturation, lightness)
Public methodStatic memberFromHsl(Single, Single, Single) Gets Color3 from HSL (hue, saturation, lightness)
Public methodStatic memberFromHsv(Double, Double, Double) Gets Color3 from HSV (hue, saturation, value / brightness)
Public methodStatic memberFromHsv(Single, Single, Single) Gets Color3 from HSV (hue, saturation, value / brightness)
Public methodGetHashCode Returns a hash code for this instance.
(Overrides ValueTypeGetHashCode)
Public methodStatic memberInterpolateHsvColor 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.
Public methodIsSame 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.
Public methodStatic memberLerp(Color3, Color3, Single) Performs a linear interpolation between two colors.
Public methodStatic memberLerp(Color3, Color3, Single, Color3)Obsolete.
Performs a linear interpolation between two colors.
Public methodStatic memberMax(Color3, Color3) Returns a color containing the largest components of the specified colors.
Public methodStatic memberMax(Color3, Color3, Color3)Obsolete.
Returns a color containing the smallest components of the specified colors.
Public methodStatic memberMin(Color3, Color3) Returns a color containing the smallest components of the specified colors.
Public methodStatic memberMin(Color3, Color3, Color3)Obsolete.
Returns a color containing the smallest components of the specified colors.
Public methodStatic memberModulate(Color3, Color3) Modulates two colors.
Public methodStatic memberModulate(Color3, Color3, Color3)Obsolete.
Modulates two colors.
Public methodStatic memberNegate(Color3) Negates a color.
Public methodStatic memberNegate(Color3, Color3)Obsolete.
Negates a color.
Public methodStatic memberParse 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.
Public methodStatic memberPremultiply(Color3, Single) Computes the premultiplied value of the provided color.
Public methodStatic memberPremultiply(Color3, Single, Color3)Obsolete.
Computes the premultiplied value of the provided color.
Public methodSaturate Update the color values to be between 0 and 1.
Public methodStatic memberSaturate(Color3)Obsolete.
Restricts color values to be between 0 and 1.
Public methodStatic memberScale(Color3, Single) Scales a color.
Public methodStatic memberScale(Color3, Single, Color3)Obsolete.
Scales a color.
Public methodStatic memberSmoothStep(Color3, Color3, Single) Performs a cubic interpolation between two colors.
Public methodStatic memberSmoothStep(Color3, Color3, Single, Color3)Obsolete.
Performs a cubic interpolation between two colors.
Public methodStatic memberSubtract(Color3, Color3) Subtracts two colors.
Public methodStatic memberSubtract(Color3, Color3, Color3)Obsolete.
Subtracts two colors.
Public methodToArgb Converts the color into a packed integer.
Public methodToArray Creates an array containing the elements of the color.
Public methodToBgr Converts the color into a packed integer.
Public methodToBgra Converts the color into a packed integer.
Public methodToHexString Returns a string that represents a hex value of this color in format: RRGGBB, for example red color is "FF0000"
Public methodToKnownColorString 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.
Public methodToRgb Converts the color into a packed integer.
Public methodToRgba Converts the color into a packed integer.
Public methodToString Returns a String that represents this instance.
(Overrides ValueTypeToString)
Public methodToString(IFormatProvider) Returns a String that represents this instance.
Public methodToString(String) Returns a String that represents this instance.
Public methodToString(String, IFormatProvider) Returns a String that represents this instance.
Public methodToVector3 Converts the color into a three component vector.
Public methodStatic memberTryParse 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.
Top
Extension Methods
 NameDescription
Public Extension MethodSaturate 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)
Public Extension MethodSaturate 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)
Public Extension MethodSaturate 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)
Public Extension MethodToAvaloniaColor Converts SharpEngine's Color3 to Avalonia color
(Defined by Extensions)
Public Extension MethodToColor4 Converts Color3 to Color4
(Defined by Extensions)
Public Extension MethodToColor4 Converts Color3 with alpha (or opacity) to Color4
(Defined by Extensions)
Public Extension MethodToWinUIColor Converts SharpEngine's Color3 to WinUI color
(Defined by Extensions)
Public Extension MethodToWpfColor Converts SharpEngine's Color3 to WPF color
(Defined by Extensions)
Top
See Also