Draw Function in Code Playground

How do I select a color for drawBox() inside of the Code Playground? I don’t see the way for me to select the function so that I can type in (or select) my color, once I am in the Code Playground.

1 Like

Use first letter of color

Thanks but that is not what I am asking. I can’t even get to the point of typing any characters at all. So I need help with that.

To select a colour for the drawBox() function inside of Code Playground, follow these steps:

  1. Click/press inside the brackets of the function.

  2. Once the coding keyboard appears, look for the string key that has the letters str then a keyboard icon :keyboard: (as shown in this screenshot).

  3. You are then able to type the name of the colour that you wish to use as a string.

As described in the Gabonese Flag Helper explainer:

Here is a list of the colours that have been programmed into the Grasshopper app for this custom JavaScript function.

Each letter of the alphabet corresponds with a colour. These can be used as an input into the drawBox() function as a word or as an input in the drawBoxes() function as the first letter of the colour.

Here is an example of both functions: