//drew a rectangle filled with blue:
private var bitmap:Bitmap = new Bitmap(new BitmapData(width, heigh, false, 0x0000FF));
On the old device a rectangle doesn’t blue (0x0000FF), it’s red (0xFF0000). Color are reads backwards.
Green is green (0x00FF00 > 0x00FF00). Blue is red (0x0000FF > 0xFF0000). Red is blue. Any colors is backwards color, if it isn’t mirror. (as green (0x00FF00) or 0x321123.
Shape is correctly display colors. Problem only with BitmapData. Can it fixed (for specific device)?
It looks like a problem with Endian-ness. Devices can be big-endian or little-endian which means they read numbers from left to right or right to left. I can’t see any place where this is checked / accounted for in the OpenFL source and I’m not sure if / where a check would be required.
@singmajesty On a side note… what’s the trick to find the CPP code called from a lime_* library function in legacy? I track it as far as the ExternalInterface.cpp and then lose it. I found the other ExternalInterface.cpp in the common folder.
Sorry, I meant have you tried it on Windows or Neko to see if the problem is still there. I seem to remember reading somewhere that bitmaps are usually saved in RGBA format but Flash uses BGRA format which could explain this issue if it’s getting confused somewhere?
That’s interesting because the Windows and Neko builds should be using mostly the same code as the Android version. Have you tried it with later versions of Android? If that shows the true colours it may be something to do with architectures again. Maybe something like the endian-ness I mentioned in my first post.
I think, that problem only on specific device. BitmapData colors reading right to left. Question, how it’s track (I know solving problem, but I do not know when to apply the solution)?
I think, you are right. But how track this?
Problem only on BitmapData. Shape got true colors. BitmapData is not.
Indeed it seems that the color Blue is swapped with the color Red and only on textures.
If I use a white sprite with color transforms the colors look right.
This happens only on ARMv5 devices like Samsung Galaxy Y on android 2.3.
It started 1 year ago after upgrading the OpenFL, before the upgrade the colors were correct.
I still have apks build in February 2014 that don’t have this problems on the same old devices.
Yellow is swapped with blueish
Blueish with yellowish
Some reds are shown as blue
Not everywhere though, some SVG loaded images are showing up fine, and others aren’t. ( Stars are showing up correctly as yellow, also the blobs, which are textures, show up correctly as pink )
Interestingly the game camera itself seems to be fine, however our UI and background cameras have that weird color swap.
I’m not sure if related, but when we tried making programmatical screenshots on Android, we also get a color swap issue that we first thought was blend mode related.