Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace TryItOutClasses
- {
- public class Color
- {
- public int red;
- public int green;
- public int blue;
- public int transparency;
- public Color(int red, int green, int blue, int transparency)
- {
- this.red = red;
- this.green = green;
- this.blue = blue;
- this.transparency = transparency;
- }
- public Color(int red, int green, int blue)
- {
- this.red = red;
- this.green = green;
- this.blue = blue;
- transparency = 255;
- }
- public int RetriveRed()
- {
- return red;
- }
- public int RetriveGreen()
- {
- return green;
- }
- public int RetriveBlue()
- {
- return blue;
- }
- public int RetriveTransparency()
- {
- return transparency;
- }
- public float RetriveGrayscale()
- {
- float grayscale = (red + green + blue) / 3;
- return grayscale;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment