Facility Control

 View Only
  • 1.  Help with Color Picker popup

    Posted 06-18-2020 17:25

    Im working on a dashboard to select team colors. I have the example in front of me, but do not seem to understand how to get rrggbb values in my params. It looks like hex to me. 

    Can anyone point me in a direction?

     

    <abs contexttype="opengear" dblinqport="2223" id="_top" keepalive="false">
    <meta>
    <params>
    <param access="1" maxlength="0" name="HomePrimary_color_rgba" oid="HC1" type="STRING" value="#BE0202" widget="color-picker"/>
    <param access="1" maxlength="0" name="HomeSecondary_color_rgba" oid="HC2" type="STRING" value="#B8B8B8" widget="color-picker"/>
    </params>
    </meta>
    <label header="true" height="23" left="684" name="Home Primary Color" style="txt-align:west" top="18" width="193"/>
    <param anchor="west" expand="true" fill="none" height="40" left="684" oid="HC1" showlabel="false" top="46" weightx="1.0" weighty="1.0" widget="color-picker-popup" width="200">
    <config key="w.showstring">true</config>
    <config key="w.format">rgba</config>
    </param>
    <label header="true" height="23" left="684" name="Home Secondary Color" style="txt-align:west" top="99" width="193"/>
    <param anchor="west" expand="true" fill="none" height="40" left="686" oid="HC2" showlabel="false" top="122" weightx="1.0" weighty="1.0" widget="color-picker-popup" width="200">
    <config key="w.showstring">true</config>
    <config key="w.format">rgba</config>
    </param>
    </abs>



  • 2.  RE: Help with Color Picker popup

    Posted 06-19-2020 15:18

    Hi Chris

    It looks like you're correctly exposing the color values via DataLinq. Is the issue that you are not able to make use of them in your XPression materials?  If so, you may want to post your question into the XPression forum.

     

    You are correct that the values being sent to DataLinq are hex - they are the RGB values from 0x00 to 0xFF (the same way HTML color values are encoded).

    If I am missing something or if you would like assistance on the DashBoard side, please let me know and we can discuss further.

     

    Cheers

    James


    #DashBoard


  • 3.  RE: Help with Color Picker popup

    Posted 06-26-2020 00:58

    Hi James, and hi there Chris!

    I think I touched upon this one a while back myself, and I get your "problem" here Chris.
    The issue James, is that while the color picker gives us the ARGB or RGBA (depending on the setting), it will give us the individual values in #AARRGGBB in hex, and it ONLY gives us alpha (A) if it's anything else than 0-value, wich is in fact FF when translated to the way the alpha value from the color picker works...

    Then comes Xpression, now I dont have the v10 version that's comming out, and havent had a chance to look at it, but in v9.5 the different ways you can set the color values in visual logic at least is through the two blocks "FloatColor" and "IntColor".

    FloatColor is and arbitary 0.000 to 1.000 value for each of the RGBA values (in that order btw in Xpression).
    IntColor expects a value of 0-255 for RGBA (also in this order).

    None of the Xpression input values actually reads the DashBoard output as a string in itself. Now I think 2 years ago or so I asked for this in the Xpression forum, or possibly here, but getting a "HexColor" block for Xpressions visual logic would've been great. One that could read the DashBoard output of #RRGGBBAA...

    Now for your sollution Chris.
    What I did was I made a "parser function" in DashBoard, first stripping of the # in the string, then looking at the length (not really needed anymore as you can now set AA as the last part of the string), picking out the corresponding HEX pairs, and using JavaScripts parseInt() function (https://www.w3schools.com/jsref/jsref_parseint.asp), and then return this value and set the RGB value in a separate string parameter for color values, and then using this in Xpression (iex. 058176061 that would be a greenish color). Taking this string into Xpression, using the visual logic block Strings -> Mid String to then again grab the individual RRR GGG BBB values and applying them into the IntColor block, and voila, you finally got it working...

    Point James... Ross and Xpression are two products in your range that go hand in hand, but they're not expecting the same format for color codes...


    #DashBoard


  • 4.  RE: Help with Color Picker popup

    Posted 06-29-2020 14:37

    Aleksander, in Version 9.5 you can feed a hex string #RRGGBB into the material color properties (diffuse, emissive, etc.)  You can also feed it #AARRGGBB format but the AA is ignored since the alpha is not a property of the diffuse color itself but rather is a global property for the material and has a separate Alpha property in visual logic.

     


    #DashBoard


  • 5.  RE: Help with Color Picker popup

    Posted 11-17-2023 14:11

    thank you but its in a version 9.5 and iam using 8.5 so can you please help me in for 8.5 and another badluck is iam not script writer iam a grphics designer so dont know how to write script in dashboard like aleksander stalsberg said in previous comment. 



    ------------------------------
    sunil Blank
    Freelancer Graphics Designer
    Freelancer
    Kathmandu Nepal
    ------------------------------



  • 6.  RE: Help with Color Picker popup

    Posted 06-29-2020 15:03

    Aaaaaaahhhh... Have not been able to test much in 9.5 yet. NICE! Well, that makes things easier.
    I made my sollution above back in version 6.5 I believe, so yeah. But that's perfect in v9.5 then! Great! Will try at first oppertunity! And that definetly makes things alot easier.


    #DashBoard