# Feature Request: Debugging-Component "LED"

**URL:** <https://discourse.mcneel.com/t/feature-request-debugging-component-led/96983>\
**Category:** Grasshopper\
**Created:** [February 24, 2020, 10:43am UTC](https://discourse.mcneel.com/t/feature-request-debugging-component-led/96983 "2020-02-24T10:43:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![henry.langner](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/henry.langner/32/629978_2.png) [@henry.langner](https://discourse.mcneel.com/u/henry.langner)\
**Post date:** [February 24, 2020, 10:43am UTC](https://discourse.mcneel.com/t/feature-request-debugging-component-led/96983/1 "2020-02-24T10:43:31Z")

</div>

Hi all,

I’d like to make a feature request for a simple debugging component, maybe there is someone out there who could make this. It could be useful for many GH programmers.

The component I’d like to have shall be just a simple on/off display, being green if the input value is “true” and being red if the input value is “false”. Just like a small LED which is soldered to a large circuit board.

Currently I’m using a small snippet that I built from a panel and MetaHopper components. Here is how it looks like:

 ![screen-ampel](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/c/9/c91bd56b2b9de0fac5d1cb295eec226e1e0d7600.png)

It does its job, but I’d prefer a single-component solution for tidiness.

Important to me is, that I can scale the panel to any size I want so that it is large enough to recognize its color even if the canvas is fully zoomed out.

Maybe this can be done with a panel using two inputs (text/bool)? Maybe there is already a single-component-solution? Any help appreciated.

Cheers, Henry

---

<div class="post-metadata">

**Author:** ![maje90](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maje90/32/771922_2.png) [@maje90](https://discourse.mcneel.com/u/maje90)\
**Post date:** [February 25, 2020, 12:50am UTC](https://discourse.mcneel.com/t/feature-request-debugging-component-led/96983/2 "2020-02-25T00:50:13Z")

</div>

![2020-02-25 01_35_21-Window](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/d/4/d4ab99ef3a6544f8228bfd53e8d98d1066f30350.png)  
You can do something with a bunch of rows in c#.

Code: (it needs a “using System.Drawing;” on top)

```
  private void RunScript(Color C, ref object P)
  {
    Grasshopper.Kernel.Special.GH_Panel panel;
    panel = (Grasshopper.Kernel.Special.GH_Panel) this.Component.Params.Output[0].Recipients[0];
    panel.Properties.Colour = C;
    P = " ";
  }

```

[panel\_color.gh](https://discourse.mcneel.com/uploads/short-url/p53tpP2kxAKEVfeupmfqSmWdCLH.gh) (12.7 KB)

You can make even blinking ones, if in need.

 ![panel_color](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/0/8/080eabfce026bd36e6106f9a953467183756c7a1.gif)  
Gif color compression gone bad :\

Edit:  
You can edit the script so it accepts integers as input and then internally the color is decided by a couple of IFs:

```
  private void RunScript(int x, ref object P)
  {
    System.Drawing.Color C;
    if(x==0) C = System.Drawing.Color.Red;
    if(x==1) C = System.Drawing.Color.Lime;

    Grasshopper.Kernel.Special.GH_Panel panel;
    panel = (Grasshopper.Kernel.Special.GH_Panel) this.Component.Params.Output[0].Recipients[0];
    panel.Properties.Colour = C;
    P = " ";
  }
```
