Facility Control

 View Only
  • 1.  Suggestion: Color picker

    Posted 07-20-2019 22:58

    Ok, so I want to suggest something when it comes to parameters and color picker.

    As it is now:

    When you use the color picker, you get a string as an result. It's in hex values and is preformatted with a #.

    Now, when you DONT touch the alpha value, it's 6 values.
    #FFFFFF for white, and #000000 for black.

    However, if you touch the alpha value, and it's anything BUT 0, it will be bumped up to 8 values.
    Say if you set alpha to 100, the value will be #00FFFFFF for white, and #00000000 for black.

    Not only does the alpha variable go "backwards" (yes I do understand why, as 100 means 100% invisible), but the value goes down to 0, but if you leave the transparency at 0, or what would've been FF it instead reverts back to 6 values.

    My suggestions:

    • Make sure that the alpha value is allways there, even at 0 transparency (100% visibility). Having it not there just makes it weird trying to code something to use it... Can be done of course, but it's just... Inconsistent...

    • Have a chat with your Xpression team, as there is no way to actually USE these values in Xpression. The material color input does not approve a string input with the correct format, but must instead pass through a color block. Neither of them accepts hex as an input, not in it's full length, and not in RGBA input, or ARGB as you'd get from DashBoard.
      Please make it so that you could either use the string input straight into a color block, or so that you could use the individual parts as a hex input block in Xpression.
      Or even better yet, let the output from color picker in DashBoard be an int value from 000-255 instead, so that it can more easilly be used together.

    Just my two cents! I've found a workaround, but it's still just silly if you ask me.



  • 2.  RE: Suggestion: Color picker

    Posted 07-21-2019 21:43

    To make it even more confusing...

    When you get the value from the color picker, and if you have changed the transparency, the string value from that parameter is given as #ARGB with alpha first.

    However if you set a background color on a canvas in DashBoard, it's set as #RGBA, in other words, again, the alpha value is only present IF you have picked the color. But to top that of, the alpha value is not even on the same side as from the color picker.

    But as you can imagine, this makes using the color picker to set a background somewhat more finicky than needed. As you get the Alpha value from the picker, as the canvas background R value, and the pickers B value as the canvas background Alpha value.
    Meaning you have to make a function to get the correct values, reorder them based on how many values there are, and then rearrange them.

    And that's not even touching in on getting the value into Xpression again.


    #DashBoard


  • 3.  RE: Suggestion: Color picker

    Posted 07-26-2019 15:04

    I'll file an improvement request to configure the color format from ARGB to RGBA (and vice versa). You're right about the inconsistency in how the parameter works compared to the styling information for CustomPanels.

    I should note that the color picker widget can also be used with INT32 parameters and will be ARGB for each byte in the INT - not sure if that would be of more value to you or not when trying to pass information to XPression.

    In the meantime, your workaround of using 2 parameters and a conversion function is your best bet. If you use the INT32 approach, the function is fairly straight forward and generic:

     

     


    #DashBoard