-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPixel.cs
More file actions
46 lines (38 loc) · 989 Bytes
/
Pixel.cs
File metadata and controls
46 lines (38 loc) · 989 Bytes
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
39
40
41
42
43
44
45
46
using System.Drawing;
namespace Project_Info
{
public class Pixel
{
public Pixel(int red, int blue, int green)
{
this.Red = red;
this.Blue = blue;
this.Green = green;
}
public Pixel()
{
Red = 0;
Blue = 0;
Green = 0;
}
public Pixel(Pixel pixel)
{
Red = pixel.Red;
Green = pixel.Green;
Blue = pixel.Blue;
}
public int Red { get; set; }
public int Blue { get; set; }
public int Green { get; set; }
public string HexString
{
get
{
Color myColor = Color.FromArgb(Red, Green, Blue);
string hex = myColor.R.ToString("X2") + myColor.G.ToString("X2") + myColor.B.ToString("X2");
return hex;
}
}
public bool IsBlack => Red == 0 && Green == 0 && Blue == 0;
}
}