GetBackgroundPixelColor seems to detect Ball color

I found this while working on another project.

GetBackgroundPixelColor seems to return the Ball color instead of the Canvas background color.

I made a new simple project to test it, and I got the same result.

I attached the Blocks, component settings, and test result below.

Is this expected behavior or a bug?

Sorry for the photos of my computer screen — I know they’re not the easiest on the eyes.

Both getbackgroundpixelcolor and getpixelcolor seems working properly, tested on android 15 in emulator, clicking on ball you can see the background is white while color is black ( see attached aia ).

Blocks

canv02.aia (3.5 KB)

1 Like

Also no issues here on Android 17 with companion.

1 Like

Colors in blocks are deceptive.

I have been burnt by this.

They look similar to a Designer setting, but might differ numerically.

For a more robust approach, initialize a global variable named backgroundColor to your grey block.

In Screen Initialize, set Canvas Background Color to global backgroundColor.

Use the global variable in the comparison, not the color block.

P.S. I should have named the global variable in all caps, to tell other people that it's intended to be a constant value.

P.P.S. This is a special case of a general coding rule for robustness:

The only run time literals allowable should be 0, 1, or empty text.

Everything else should be declared in a constant.

This may be an iOS-specific bug given the screenshot in the initial post is iOS.

1 Like

I use the iOS 26.6.1in iPhone 17promax may is the device problem

I confirmed that this is an issue on iOS. We will investigate further.