Sign in to follow this  
Varmint007

How to perform (XML) calculations on hex values?

Recommended Posts

I saw a post awhile back touching on the addition, subtraction, etc, if hex values within XML, but I can't seem to find it.I'm looking to manipulate color values within Color="" arguments, such as Color="%(thishexvalue thishexvalue +)".Has anyone had any success doing that? I use extensive macros to manipulate color, but I'd like to dispose of that if possible.--Jon

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

The following text was from Arne BartelsColor="%((L:EICAS lamp bright,number) 0x7f + 0x100 * )%"I got at last a dimmable String.Color="%((L:bright,number) 0x7f + 0x100 * )%"Any colour you want (RGB). It might have been simpler tounderstand by using something like:Color="%( 0x00ff00 (L:bright,number) * near )%"With (L:bright,number) between 0.0 (dark) and 1.0 (fulllit). 0x00ff00 the RGB colour value (0xff = 255 for greenpart, 0 for the others).Arne BartelsMaybe you work with single"colour channels", and stick them together later? Anumber between 0x00 and 0xff multiplied by 0x01 is blue,multiplied by 0x100 is green, multiplied by 0x10000 is redand then adding all channels together.Arne BartelsThis is the code I used to vary the brightness,I know this exercise was involved with variable brightness, but it gives some indication on how to manipulate hex coding in the colour section of the gauge. With some experimentation, you may get what you require. The success of adjusting text brightness was variable, text tending to change colour with brightness levels. If you have success with this, maybe you could post back.I hope this helps.Nickhttp://www.fs2x.com/images/fs2x.gif

Share this post


Link to post
Share on other sites

Hi,I use:Color="%( (L:fmc text bright,number) 0x7f + 0x100 * )%"(L:fmc text bright,number) 10 - -100 max (>L:fmc text bright,number)(L:fmc text bright,number) 10 + 100 min (>L:fmc text bright,number)Tried many combinations of code to get the same effect for other colours with no much succes.May this way?"%( 255 (L:fmc text bright,number) * )%"(L:fmc text bright,number) 1 - 40 max (>L:fmc text bright,number)(L:fmc text bright,number) 10 + 292 min (>L:fmc text bright,number)Slowly from red via orange and yellow to green.So, also very curious how to get a hold on that "mysterious" type of code, also used in the gps.Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this