Skip to main content
Topic: Columns UI - Set rgb with value from a variable (Read 244 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Columns UI - Set rgb with value from a variable

I'm struggling with getting this to work in the globals variables tab.

I want to have both a global for the value and the RGB.

Code: [Select]
$set_global(txthighlightvalue,216,237,201)
$set_global(txthighlightclr,$rgb($get_global(txthighlightvalue)))

Is this possible to assign the value then use it again in the rgb function?

Re: Columns UI - Set rgb with value from a variable

Reply #1
I haven't tested for myself (sorry, back to Default UI since 2014...), but setting the variable to

Code: [Select]
$set_global(cTxtHighlight,$rgb(216,237,201))

should work. Then set color anywhere with

Code: [Select]
$get_global(cTxtHighlight)

Source: https://brother-john.net/tagz/create-colour-scheme.html

If you really need to store the individual values for R, G, B, I fear you will have to use three globals:

Code: [Select]
$set_global(cTxtHighlightR,216)
$set_global(cTxtHighlightG,237)
$set_global(cTxtHighlightB,201)

and then use them like:

Code: [Select]
$set_global(cTxtHighlight,$rgb($get_global(cTxtHighlightR),$get_global(cTxtHighlightG),$get_global(cTxtHighlightB)))

Re: Columns UI - Set rgb with value from a variable

Reply #2
Thanks for the reply.

Individual variables? Really, there's no other way to set the 3 values to one variable?

 
SimplePortal 1.0.0 RC1 © 2008-2020