Saving a Xojo Project in binary format messed up colors

A weird thing just happened. I had an open project (saved as Xojo Project), pressed Command-S and saved it as Xojo Binary Project. When I opened back the saved binary project, colors of many controls messed up. The “blue” value was reset to zero, making white labels yellow, etc. The interesting part is some kind of transparency that appeared in color swatches in the IDE:

I wonder what else got messed up…

Unfortunately, I cannot reproduce it with any other test project, so I haven’t filed up a bug.

Happens with Real Studio 2012 r2.1 as well. All my textfields were yellow after opening a saved binary project. Can’t reproduce it unfortunately.

Nothing else was modified in my project fortunately ( as far as I could tell )

I believe that you will discover that the red value has been dropped and the alpha value has become the blue value. i.e.: &cFFFFFF00 (white) becomes &cFFFF00 (yellow)

It didn’t dawn on me that the binary save might be the problem. I’ll update the bug report <https://xojo.com/issue/27611>

I’m not clear on something
The issue is saving as binary then reopening the project in the current version ?
Or saving as binary then going back to an old version and the old version shows the colors wrong ?

happend to me to, opening any app with new version 2104 R3

I’ve seen it in both directions. However, it seems to be related to the original project coming from an earlier RB/RS version.

2104 … cool :stuck_out_tongue:

Old versions did write the colors incorrectly sometimes
In 2012r2.1 I put a color as &c87654321
Save & read it back in in 2012r2.1 I get &c654321
So its certainly possible

That’s not fair! Using a time machine to get a future version of Xojo, then coming back here to report bugs!

Pretty cool to know that Xojo will be around in 2104 however. Now can you tell me where the Apple stock was? Should I buy some more?

I wonder who’s fixing bugs in 2104 ?
I expect I’ll be long gone by then :stuck_out_tongue:

[quote=155966:@Norman Palardy]Old versions did write the colors incorrectly sometimes
In 2012r2.1 I put a color as &c87654321
Save & read it back in in 2012r2.1 I get &c654321
So its certainly possible[/quote]
Then, the question is why didn’t we see the color mangling when reloading in the older versions?

Probably because the older version only expected a 6 digit hex value so took the LAST 6 (dropping the Alpha)

So I bet if you take a new project with &c87654321, save it
load it with an older version
save it with an older version
load it in the new version again, the color will have changed to &c654321 in the new version

The hard part is in some places ALPHA is 1st 2 digits, and in others its the last 2 (probably to keep as much backward compatiblity as possible I’d guess)

Gotta love variants :stuck_out_tongue:

[quote=156101:@Dave S]Probably because the older version only expected a 6 digit hex value so took the LAST 6 (dropping the Alpha)

So I bet if you take a new project with &c87654321, save it
load it with an older version
save it with an older version
load it in the new version again, the color will have changed to &c654321 in the new version[/quote]
That one example of what we’re seeing, but we’re seeing it when moving the code forward without moving backwards first, as well.

And that is the magic formula.

Oh you have no idea how much of a vendetta I’ve waged about variant usage in the IDE.
It’s caused many bugs over the years.

[quote=156107:@Norman Palardy]Oh you have no idea how much of a vendetta I’ve waged about variant usage in the IDE.
It’s caused many bugs over the years.[/quote]
Variants are devil spawn. Auto will take some time getting used to but it will eliminate (hopefully) crap like this.

[quote=155959:@Norman Palardy]I’m not clear on something
The issue is saving as binary then reopening the project in the current version ?
Or saving as binary then going back to an old version and the old version shows the colors wrong ?[/quote]

Opening the project in 2014r3.1, saving it as binary and then opening the binary version (still in 2014r3.1).

[quote=155966:@Norman Palardy]Old versions did write the colors incorrectly sometimes
In 2012r2.1 I put a color as &c87654321
Save & read it back in in 2012r2.1 I get &c654321
So its certainly possible[/quote]

I have never saved that particular project in anything older than 2014r3.1 (the current version) or 2013r3.3. In fact, it is even quite unlikely that I have ever saved it using 2013r3.3, but I might have done it accidentaly. Definitely not 2012.

I’d try 2014r3 and see

I just did and I get “some” of the TextField and Label backcolors set to &cFFFF00 on the reload. I can’t determine a specific relationship. It also seems to happen on random controls where I don’t manually assign a backcolor.

The only consistent element is that it only occurs with Binary projects and the affected controls all appear to be either TextFiled/Area or Labels.