Represents the same 32-bit ARGB color as the Color structure does but in a more optimized way
for better performance and smaller memory consumption.
Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 7.0.0-preview.2
Syntax
The Color32 type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | Color32(Color) |
Initializes a new instance of the Color32 struct from a Color instance.
|
![]() | Color32(Byte, Byte, Byte) |
Initializes a new instance of the Color32 struct from RGB (red, green, and blue) values.
|
![]() | Color32(Byte, Byte, Byte, Byte) |
Initializes a new instance of the Color32 struct from ARGB (alpha, red, green, and blue) values.
|
Methods
Name | Description | |
---|---|---|
![]() | Equals(Color32) |
Determines whether the current Color32 instance is equal to another one.
|
![]() | Equals(Object) |
Determines whether the specified Object is equal to this Color32 instance.
(Overrides ValueTypeEquals(Object).) |
![]() ![]() | FromArgb(Int32) |
Creates a Color32 structure from a 32-bit ARGB value.
|
![]() ![]() | FromArgb(Byte, Color32) |
Creates a Color32 instance from the specified Color32 structure, but with the new specified alpha value.
|
![]() ![]() | FromGray |
Creates a Color32 structure representing a grayscale color of the specified brightness.
|
![]() ![]() | FromRgb |
Creates a Color32 structure from a 24-bit RGB value. The highest byte of the specified integer is ignored
and the A property of the result will be 255.
|
![]() | GetHashCode |
Returns a hash code for this instance.
(Overrides ValueTypeGetHashCode.) |
![]() | ToArgb |
Gets the 32-bit ARGB value of this Color32 instance.
|
![]() | ToColor |
Converts this Color32 instance to a Color structure.
|
![]() | ToGray |
Gets a Color32 instance that represents the matching gray shade of this Color32 instance based on human perception.
|
![]() | ToOpaque |
Gets a Color32 instance that represents this Color32 without alpha (transparency).
|
![]() | ToRgb |
Gets the 24-bit RGB value of this Color32 instance. The most significant byte of the returned integer is zero.
|
![]() | ToString |
Gets the string representation of this Color32 instance.
(Overrides ValueTypeToString.) |
Operators
Name | Description | |
---|---|---|
![]() ![]() | Equality |
Gets whether two Color32 structures are equal.
|
![]() ![]() | (Color to Color32) |
Performs an implicit conversion from Color to Color32.
|
![]() ![]() | (Color32 to Color) |
Performs an implicit conversion from Color32 to Color.
|
![]() ![]() | Inequality |
Gets whether two Color32 structures are different.
|
Fields
Name | Description | |
---|---|---|
![]() | A |
Gets the alpha component value of this Color32 structure.
|
![]() | B |
Gets the blue component value of this Color32 structure.
|
![]() | G |
Gets the green component value of this Color32 structure.
|
![]() | R |
Gets the red component value of this Color32 structure.
|
Extension Methods
Name | Description | |
---|---|---|
![]() | Blend |
Blends the specified foreColor and backColor.
It returns foreColor if it has no transparency (that is, when A is 255); otherwise, the result of the blending.
(Defined by ColorExtensions.) |
![]() | GetBrightness |
Gets the brightness of a Color32 instance as a byte based on human perception.
The A component of the specified value is ignored.
(Defined by ColorExtensions.) |
![]() | TolerantEquals |
Gets whether two Color32 instances are equal using a specified tolerance.
(Defined by ColorExtensions.) |
See Also