public Bitmap BuildTile(Color color)
 {
     var clr = new HSV(color);
     Bitmap src = GetSource();
     var bmp = new Bitmap(src.Width, src.Height);
     for (int x = 0; x < bmp.Width; x++)
     {
         for (int y = 0; y < bmp.Height; y++)
         {
             Color original = src.GetPixel(x, y);
             Color altered = Color.FromArgb(0, 255, 255, 255);
             var orighsv = new HSV(original);
             Color origrgb = orighsv.Color;
             origrgb = Color.FromArgb(original.A, origrgb.R, origrgb.G, origrgb.B);
             if (!origrgb.Equals(altered))
             {
                 orighsv.Hue = clr.Hue;
                 //orighsv.Saturation = clr.Saturation;
                 //orighsv.Value = clr.Value;
                 altered = orighsv.Color;
                 altered = Color.FromArgb(original.A, altered.R, altered.G, altered.B);
             }
             bmp.SetPixel(x, y, altered);
         }
     }
     src.Dispose();
     return bmp;
 }
Example #2
0
        public static Color FromHsv(int h, int s, int v)
        {
            var hsv = new HSV(h, s, v);

            return(hsv.Color);
        }
Example #3
0
 public static Color FromHsv(int h, int s, int v)
 {
     var hsv = new HSV(h, s, v);
     return hsv.Color;
 }