Files @ 41381c24d35a
Branch filter:

Location: ATITD-Tools/Desert-Paint-Lab/PaintColor.cs - annotation

Jason Maltzen
Now supports all the interface sizes with a setting to select the current interface size. The initial screen size check now displays the detected resolution as a hint. The screen size check / interface size settings can now be updated after launch through File->Preferences. Capturing a reaction now includes a progress bar, and runs in a separate thread instead of silently blocking. The reaction status window under 'Help' now has options to disable ingredients to remove them from the list. NOTE: this also disables/enables those ingredients in the recipe generator as well. The list also updates as new reactions are recorded instead of requiring that it be closed and re-opened to update.
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
63ce80f17b8c
using System;
namespace DesertPaintLab
{
	public class PaintColor
	{
		byte red;
		byte green;
		byte blue;

		string name;
		
		public byte Red
		{
			get
			{
				return red;	
			}
			set
			{
				red = value;	
			}
		}

		public byte Blue
		{
			get
			{
				return blue;	
			}
			set
			{
				blue = value;	
			}
		}
		
		public byte Green
		{
			get
			{
				return green;	
			}
			set
			{
				green = value;	
			}
		}
		
		public string Name
		{
			get
			{
				return name;
			}
			set
			{
				name = value;	
			}
		}
		
		public PaintColor()
		{
			name = "Undefined";
			red = 0;
			green = 0;
			blue = 0;
		}
		
		public PaintColor(string name, string hexRed, string hexGreen, string hexBlue)
		{
			this.name = name;
			red = (byte)System.Int32.Parse(hexRed,
				System.Globalization.NumberStyles.AllowHexSpecifier);
            green = (byte)System.Int32.Parse(hexGreen,
			    System.Globalization.NumberStyles.AllowHexSpecifier);
         	blue = (byte)System.Int32.Parse(hexBlue,
			    System.Globalization.NumberStyles.AllowHexSpecifier);	
		}
		
		public PaintColor(byte red, byte green, byte blue)
		{
			name = "Undefined";
			this.red = red;
			this.green = green;
			this.blue = blue;			
		}

        public PaintColor(PaintColor other)
        {
            name = other.name;
            red = other.red;
            green = other.green;
            blue = other.blue;
        }
				
		public int GetDistanceSquared(PaintColor otherColor)
		{
			return (int)(Math.Pow(this.red - otherColor.red, 2) +
				Math.Pow(this.green - otherColor.green, 2) +
				Math.Pow(this.blue - otherColor.blue, 2));
		}
		
		public void Clear()
		{
			red = 0;
			green = 0;
			blue = 0;
		}

        public void Set(PaintColor other)
        {
            this.red = other.red;
            this.green = other.green;
            this.blue = other.blue;
            this.name = other.name;
        }
		
		public override string ToString()
		{
			return "[" + name + ", " + red + ", " + green + ", " + blue + "]";
		}
		
	}
}