-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathColor.cs
38 lines (33 loc) · 1.16 KB
/
Color.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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);
}