QUESTIONS: Custom Block COLOR parameter

Issue #109 resolved
Turgut Guneysu created an issue

Hi John,

I did not pay too much attention to the custom block parameters before, but in this tested version I noticed the COLOR option. However, the values seem to be 0-31. Quite odd from the standard RGB one is used to.

1 - Any reason why it is so; or will it ever be 0-255 ?

And, when one displays it, reporter returns a strange number instead of a list with three values, R,G,B|

eg:

RED R=31 G=0 B=0 returns 20316116, GREEN R=0 G=31 B=0 returns 3072, BLUE R=0 G=0 B=31 returns 31.

2 - Where do these numbers come from ?

3 - ALSO: If this COLOR option is available, why is there no other instances of it in the normal block usage or commands or reporters, for users to make use of it ?

Comments (2)

  1. John Maloney repo owner

    The old color scheme (0-31 for each color channel) dates from long before MicroBlocks supported TFT display. That range was chosen to optimize the use of color with NeoPixels in one of our first workshops.

    However, when TFT support was added that color range no longer seemed like a great choice. In July of 2020, we switched to the more standard 24-bit RGB color representation, with a 0-255 range for each color channel. The VM now maps these standardized color values in ways appropriate for various output devices, both NeoPixels and various kinds of display screens.

  2. Log in to comment