Struct Color32 ​
Namespace: ValveResourceFormat.Renderer.Utils
Assembly: Renderer.dll
32-bit RGBA color with byte component storage.
public record struct Color32 : IEquatable<Color32>Implements ​
Constructors ​
Color32(uint) ​
32-bit RGBA color with byte component storage.
public Color32(uint PackedValue)Parameters ​
PackedValue uint
Color32(byte, byte, byte) ​
Initializes a new color from RGB byte components with full opacity.
public Color32(byte r, byte g, byte b)Parameters ​
r byte
Red component (0-255).
g byte
Green component (0-255).
b byte
Blue component (0-255).
Color32(byte, byte, byte, byte) ​
Initializes a new color from RGBA byte components.
public Color32(byte r, byte g, byte b, byte a)Parameters ​
r byte
Red component (0-255).
g byte
Green component (0-255).
b byte
Blue component (0-255).
a byte
Alpha component (0-255).
Color32(float, float, float, float) ​
Initializes a new color from RGBA float components.
public Color32(float r, float g, float b, float a)Parameters ​
r float
Red component (0.0-1.0).
g float
Green component (0.0-1.0).
b float
Blue component (0.0-1.0).
a float
Alpha component (0.0-1.0).
Fields ​
Black ​
Black color (0, 0, 0, 255).
public static readonly Color32 BlackField Value ​
Blue ​
Blue color (0, 0, 255, 255).
public static readonly Color32 BlueField Value ​
Green ​
Green color (0, 255, 0, 255).
public static readonly Color32 GreenField Value ​
Red ​
Red color (255, 0, 0, 255).
public static readonly Color32 RedField Value ​
White ​
White color (255, 255, 255, 255).
public static readonly Color32 WhiteField Value ​
Yellow ​
Yellow color (255, 255, 0, 255).
public static readonly Color32 YellowField Value ​
Properties ​
A ​
Gets or sets the alpha component (0-255).
public byte A { readonly get; set; }Property Value ​
B ​
Gets or sets the blue component (0-255).
public byte B { readonly get; set; }Property Value ​
G ​
Gets or sets the green component (0-255).
public byte G { readonly get; set; }Property Value ​
HexCode ​
Gets the color as an 8-character hex string in #RRGGBBAA format.
public readonly string HexCode { get; }Property Value ​
PackedValue ​
public uint PackedValue { readonly get; set; }Property Value ​
R ​
Gets or sets the red component (0-255).
public byte R { readonly get; set; }Property Value ​
Methods ​
FromVector4(Vector4) ​
Creates a color from a where XYZW maps to RGBA.
public static Color32 FromVector4(Vector4 vector)Parameters ​
vector Vector4
Vector with color components (0.0-1.0).
Returns ​
The converted color.
ToLinearColor() ​
Converts this color to a linear color space with components in the range [0, 1].
public readonly Vector4 ToLinearColor()
