How do I enable Color Inputs in my extension?

I wanted to do that before. I searched for a Color Class at the GitHub Open-Source, but couldn't find one.

Could someone tell me how do take a Color block as Input ?

What about checking the MIT sources?
Taifun

1 Like

Didn't you notice this part ? Or was I not clear ? :sweat_smile:

To find an example, you have to search for a component, which uses colors... for example the Ball...

Taifun

1 Like

I used this code for a property block when I actually need a hex colour output from a colour block.

@SimpleProperty(description = "change colour of background on html, must be done before calling pdf. Set to -1 to return to default.")
  public void SetBackgroundColour(int colour) {
    if ( colour == -1 ) {
      bgCol = "#ddffdd";
    } else {
      bgCol = "#" + Integer.toHexString(colour).substring(2);
    }
  }

As a quick workaround you could do the same, just modify your existing code.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.