Example #1
0
 public void assign_color(ColourRGB _rgb)
 {
     if (red != _rgb.red)
         color_has_changed = true;
     if (green != _rgb.green)
         color_has_changed = true;
     if (blue != _rgb.blue)
         color_has_changed = true;
     red = _rgb.red;
     green = _rgb.green;
     blue = _rgb.blue;
 }
Example #2
0
        public void set_colour(string colour_name)
        {
            ColourRGB color_before_change = new ColourRGB();

            color_before_change.assign_color(this);
            red   = 0;
            green = 0;
            blue  = 0;
            if (colour_name.ToLower() == "black")
            {
                return;
            }
            if (colour_name.ToLower() == "blue")
            {
                blue = 255;
            }
            if (colour_name.ToLower() == "red")
            {
                red = 255;
            }
            if (colour_name.ToLower() == "green")
            {
                green = 255;
            }
            if (colour_name.ToLower() == "purple")
            {
                red  = 255;
                blue = 255;
            }
            if (colour_name.ToLower() == "sky blue")
            {
                red   = 135;
                green = 206;
                blue  = 255;
            }
            if (red != color_before_change.red)
            {
                color_has_changed = true;
            }
            if (green != color_before_change.green)
            {
                color_has_changed = true;
            }
            if (blue != color_before_change.blue)
            {
                color_has_changed = true;
            }
        }
Example #3
0
 public LedList() // constructor for LedCube Object
 {
     for (int x = 0; x < 4; x++)
     {
         for (int y = 0; y < 4; y++)
         {
             for (int z = 0; z < 4; z++)
             {
                 Led led = new Led();
                 led.set_address(x, y, z);
                 leds.Add(led);
             }
         }
     }
     current_led   = led_by_address(0, 0, 0);
     current_color = new ColourRGB();
 }
Example #4
0
 // constructor for LedCube Object
 public LedList()
 {
     for (int x = 0; x < 4; x++)
     {
         for (int y = 0; y < 4; y++)
         {
             for (int z = 0; z < 4; z++)
             {
                 Led led = new Led();
                 led.set_address(x, y, z);
                 leds.Add(led);
             }
         }
     }
     current_led = led_by_address(0, 0, 0);
     current_color = new ColourRGB();
 }
Example #5
0
 public void assign_color(ColourRGB _rgb)
 {
     if (red != _rgb.red)
     {
         color_has_changed = true;
     }
     if (green != _rgb.green)
     {
         color_has_changed = true;
     }
     if (blue != _rgb.blue)
     {
         color_has_changed = true;
     }
     red   = _rgb.red;
     green = _rgb.green;
     blue  = _rgb.blue;
 }
Example #6
0
 public void set_colour(string colour_name)
 {
     ColourRGB color_before_change = new ColourRGB();
     color_before_change.assign_color(this);
     red = 0;
     green = 0;
     blue = 0;
     if (colour_name.ToLower() == "black")
         return;
     if (colour_name.ToLower() == "blue")
         blue = 255;
     if (colour_name.ToLower() == "red")
         red = 255;
     if (colour_name.ToLower() == "green")
         green = 255;
     if (colour_name.ToLower() == "purple")
     {
         red = 255;
         blue = 255;
     }
     if (colour_name.ToLower() == "grey")
     {
         red = 10;
         blue = 10;
         green = 10;
     }
     if (colour_name.ToLower() == "sky blue")
     {
         red = 135;
         green = 206;
         blue = 255;
     }
     if (colour_name.ToLower() == "white")
     {
         red = 255;
         green = 255;
         blue = 255;
     }
     if (red != color_before_change.red)
         color_has_changed = true;
     if (green != color_before_change.green)
         color_has_changed = true;
     if (blue != color_before_change.blue)
         color_has_changed = true;
 }