Color number in Make color and Split color

Yellow color is:
R = 255
G = 255
B = 0
opacity = 255

  • What color number is yellow using the make color block?

N = B + (G + (R + (256 x opacity)) x 256 ) x 256

N = 0 + (255 + (255 + (256 x 255)) x 256 ) x 256 = 4294967040

  • With split color what list do we get with yellow color?

[255, 255, 0, 255]

  • What number is the yellow color?

4294967040 - 4294967296 = -256

colores_RVA.aia (2.6 KB)

1 Like
  • What color is this number 4294967295?


It is [255, 255, 255, 255]

R = 255
G = 255
B = 255
opacity = 255

It is white color.

Background Transparent Colour = 16777215 (255,255,255,0)
Background White Colour = -1 (255,255,255) (4294967295)

Maybe it's simple for you programmers. However, for someone who learns it is incomprehensible and not logical. Why are colors not presented everywhere like in the designer? Different in designer, different in blocks, and it makes a lot of confusion. After copying a component with a set color, we get the "BackgroundColor": "& HFFD4D4D4". It is in the form of a hex. Why all this confusion with decimals? I made a simple program to convert hex color to dec32 and dec64. Hex format: OPACITY R G B.
Color_decoder.aia (3.2 KB)

1 Like

More color studies here:

Wasn't simple for me either, took a lot of digging around and trial and error to figure it out.
This might help:

ANDROID and HTML Colour Codes

I understand it. What form are colors described in java? As you know from another topic, I am using the dynamic component extension. Willing to use templates, I ran into a few problems with appinventor. The first is with colors. Although appinventor exports colors to an SCM file in RGB form, it does not accept them in RGB form. Second thing, appinventor exports property values such as FontBold or FontSize as string values "12", "true" etc. But it takes values without "" that is 12, true etc. Therefore, I write that there are many illogical things here: D.