Dukascopy
 
 
Wiki JStore Search Login

Alpha values of colors in themes are incorrectly serialized and deserialized
 Post subject: Alpha values of colors in themes are incorrectly serialized and deserialized Post rating: 0   New post Posted: Wed 07 Nov, 2018, 18:34 

User rating: 0
Joined: Sat 12 Jul, 2014, 11:31
Posts: 1
Location: SlovakiaSlovakia
Hi,

I'd like to report bug. Alpha values of colors in themes are incorrectly serialized and deserialized to/from JForex\Workspaces\DEMO\ID\JForex.xml file.

I want to use HeikinAshi indicator and hide normal candles. To do that I want to set alpha value of candles to 0. When I set color of "Bull candle" in Themes settings of Master instrument | Candles to RGBA(0, 0, 0, 1)
this color is serialized in the file as <entry key="CANDLE_BULL" value="1000000"/>
and it works fine until I close JForex and reopen it again.

I did some testing and it seems that as long as there are 2 characters per each color component serialized, color is correctly deserialized and set in JForex.
For instance, if I set color to RGBA(0, 0, 0, 16), it is serialized as "10000000" and deserialized correctly.
If I set color to RGBA(0, 0, 0, 1), it is serialized as "1000000" (only 7 characters, 1 character "0" for alpha value is missing) and deserialized incorrectly to alpha value 255.
If I manually rewrite "1000000" to "01000000" (added missing leading 0), it is correctly deserialized to alpha value 1.

My guess is that when you are parsing values from xml you expect 2 hex characters for each color component and if there is only 1, you fallback to default value 255.
Please fix this, it is really annoying because every time I close JForex, it resaves entire JForex.xml and changes all colors, so manually fixing it does not help.

thanks


 
 Post subject: Re: Alpha values of colors in themes are incorrectly serialized and deserialized Post rating: 0   New post Posted: Fri 09 Nov, 2018, 15:13 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Problem was fixed in new platform version.


 

Jump to:  

cron
  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com