Files
LEDMatrix/rpi-rgb-led-matrix-master/bindings/c#/Color.cs
2025-04-07 16:52:13 -05:00

39 lines
1.2 KiB
C#

namespace RPiRgbLEDMatrix;
/// <summary>
/// Represents an RGB (red, green, blue) color
/// </summary>
public struct Color
{
/// <summary>
/// The red component value of this instance.
/// </summary>
public byte R;
/// <summary>
/// The green component value of this instance.
/// </summary>
public byte G;
/// <summary>
/// The blue component value of this instance.
/// </summary>
public byte B;
/// <summary>
/// Creates a new color from the specified color values (red, green, and blue).
/// </summary>
/// <param name="r">The red component value.</param>
/// <param name="g">The green component value.</param>
/// <param name="b">The blue component value.</param>
public Color(int r, int g, int b) : this((byte)r, (byte)g, (byte)b) { }
/// <summary>
/// Creates a new color from the specified color values (red, green, and blue).
/// </summary>
/// <param name="r">The red component value.</param>
/// <param name="g">The green component value.</param>
/// <param name="b">The blue component value.</param>
public Color(byte r, byte g, byte b) => (R, G, B) = (r, g, b);
}