Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Created by SharpDevelop.
- * User: da
- * Date: 3/27/2016
- * Time: 5:01 PM
- *
- * To change this template use Tools | Options | Coding | Edit Standard Headers.
- */
- using System;
- namespace Page_131
- {
- /// <summary>
- /// Gets and sets the color, returns grayscale.
- /// </summary>
- public class Color
- {
- public byte Red {get; set;}
- public byte Green {get; set;}
- public byte Blue {get; set;}
- public byte Alpha {get; set;}
- public Color(byte red, byte green, byte blue, byte alpha)
- {
- Red = red;
- Green = green;
- Blue = blue;
- Alpha = alpha;
- }
- public Color(byte red, byte green, byte blue)
- {
- Red = red;
- Green = green;
- Blue = blue;
- Alpha = 255;
- }
- public byte GetGrayscale()
- {
- return (byte)((Red + Green + Blue)/3);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement