Exemple #1
0
        /// <summary>
        /// http://colormine.org/color-converter
        /// </summary>
        public void TestC()
        {
            //int v1 = 0, v2 = 0; // the new vertex and the previous one

            for (var hue = 0; hue < 360; hue += 2)
            {
                var light = 40;
                for (var sat = 40; sat <= 80; sat += 10)
                {
                    var color = RGBHelper.HsvToRgb(hue, sat, light);

                    Console.WriteLine(" hue:{0:000} sat:{1:000}, light:{2:000}, color:{3:000}", hue, sat, light, color);
                    this.AddRGBSequence(true, 6, this.MaxLed, color);
                    this.Show();
                    Thread.Sleep(2);
                }
                if (Console.KeyAvailable)
                {
                    if (Console.ReadKey().Key == ConsoleKey.Q)
                    {
                        break;
                    }
                }
            }
        }
Exemple #2
0
        public static Color ToBrighter(Color color, int percent = 10)
        {
            double hue;
            double saturation;
            double value;

            RGBHelper.ColorToHSV(color, out hue, out saturation, out value);

            saturation = saturation * (1 + (percent / 100.0));
            value      = value * (1 + (percent / 100.0));

            return(RGBHelper.HsvToRgb(hue, saturation, value));
        }
Exemple #3
0
 public APA102LEDStrip AddHSV(double h, double S, double V)
 {
     this.AddRGB(RGBHelper.HsvToRgb(h, S, V));
     return(this);
 }
Exemple #4
0
 public APA102LEDStrip AddHSV(double hue, double saturation, double lightness, int brightness = -1)
 {
     return(this.AddRGB(RGBHelper.HsvToRgb(hue, saturation, lightness), brightness));
 }