O'Reilly logo

Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps by Mark Sherman, Derek Walter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Color as a List

You might have noticed the built-in blocks palette called Colors. In it are 13 color blocks, which make setting the colors of background and buttons in code blocks quick and easy. But the really interesting part is at the bottom of the palette: the make color block (see Figure 6.16).

Image

Figure 6.16 Making a custom color out of a list. This one has red at maximum and blue and green at zero. The color will be red.

Colors in App Inventor are really just lists. These lists must have exactly three items in them, and those items must be numbers, which specify the red, green, and blue parts of the color. Using the make color block, you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required