This is more DashBoard than it is Xpression I see, but it ties into it anyhow.
I see your color picker returns the values <#00E1F25C>, that is not only RGB but ARGB (Alpha, Red, Green, Blue, as the hex values allways comes in pairs to get 256 values), or "Transparacy" in the color picker in DashBoard.
This makes no sense to me, because if the transparacy is set to 0, your value would be #E1F25C, but the second you touch the transparancy slider, you get an Alpha Hex value ahead of your RGB values, meaning the index position of RGB is completly up to the mercy of the transparancy slider...
I know ROSS added an option in the color picker in DashBoard to select wether or not you want it as ARGB or RGBA, I assume, as a response to my post above...
So, if you add the w.format as rgba in the config options for the color picker, you will now have #E1F25C00 (or #E1F25C if you dont touch the transparancy slider) instead, wich makes more sense now that you know that the RGB values will allways have the correct index position in the string...
As for it including the <> signs I dont believe it does. It doesnt do that at my DashBoard anyhow...
Easiest way to check what you're getting is by using the ogscript.debug() function and look at the debug window for what you're getting.
So, just do a ogscript.debug(x); on a line after your var x declaration there and you can see wether or not the <> is included.
Hope this helps!
------------------------------
Aleksander Stalsberg
Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
Norway
------------------------------
Original Message:
Sent: 04-29-2022 18:09
From: Jake Lew
Subject: Set diffuse/ambient color through datalinq (Hex and/or decimal)
Bumping an old thread.... How did you do the following step:
- Strips the # from the hex value (left with RRGGBB)
I see the current value of my colour picker as <#00E1F25C>, so maybe I need to strip out the # and the < > symbols? I tried using a substring, but it did not seem to work
var x = params.getValue('Game_1_Away_Colour', 0);
params.setValue('Game_1_Away_Colour_Hex', 0, x.substring(3,10));
I also tried of 2,9 just in case those < > symbols don't actually count, but still no results
------------------------------
Jake Lew
Access Communications Co-Operative Limited
Original Message:
Sent: 04-24-2018 19:31
From: Aleksander Stalsberg
Subject: Set diffuse/ambient color through datalinq (Hex and/or decimal)
Maybe : instead of sending one parameter, you can stream the color as 3 parameters ( the 3 integer values ) : in Xpression use a datalinq block for each parameter and directly connect them to IntColor block.I just wonder if the 3 parameters will be processed at the same time (to avoid intermediate color behavior ) ...
I could most definetly do that!
Though seeing as Xpression still wants the values as int 0-255 for all 3, I still have to convert the values from the color picker into decimals from hex.
The last concatenate in DashBoard is simply to reduce the amount of parameters to send. As I got a feeling this DashBoard will end up with a couple hundreds total...
And and splitting them up again in Xpression was surprisingly easy with the "MID STRING" block.
#XPression