Struct ColorInt
Color, as int in 0xAARRGGBB format. Can convert from/to System.Drawing.Color, System.Windows.Media.Color, int (0xAARRGGBB), Windows COLORREF (0xBBGGRR), string.
public record struct ColorInt : IEquatable<ColorInt>
Namespace: Au.Types
Assembly: Au.dll
Constructors
Name | Description |
---|---|
ColorInt(int, bool?) | |
ColorInt(uint, bool?) |
Fields
Name | Description |
---|---|
argb | Color value in 0xAARRGGBB format. |
Methods
Name | Description |
---|---|
FromBGR(int, bool?) | Converts from Windows native COLORREF (0xBBGGRR to 0xAARRGGBB). |
FromHLS(int, int, int, bool) | Converts from hue-luminance-saturation (HLS). |
FromString(string, out ColorInt) | Converts from a color name (System.Drawing.Color.FromName) or string |
GetPerceivedBrightness(int, bool) | Calculates color's perceived brightness. |
SwapRB(int) | Converts color from ARGB ( |
SwapRB(uint) | Converts color from ARGB ( |
ToBGR(bool) | Converts to Windows native COLORREF (0xBBGGRR from 0xAARRGGBB). |
ToHLS(int, bool) | Converts to hue-luminance-saturation (HLS). |
ToString() |
Operators
Name | Description |
---|---|
explicit operator Color(ColorInt) | Converts to System.Drawing.Color. |
explicit operator Color(ColorInt) | Converts to System.Windows.Media.Color. |
implicit operator ColorInt(Color) | Converts from System.Drawing.Color. |
implicit operator ColorInt(int) | Converts from an int color value in 0xRRGGBB or 0xAARRGGBB format. Sets alpha = 0xFF if it is 0 in color. |
implicit operator ColorInt(uint) | Converts from an uint color value in 0xRRGGBB or 0xAARRGGBB format. Sets alpha = 0xFF if it is 0 in color. |
implicit operator ColorInt(Color) | Converts from System.Windows.Media.Color. |