Accesso rapido:  

Forum: VirtualDJ Skins

Topic: Border Color using placeholder
djkrysrPRO InfinityMember since 2010
Hi
I have asked this before but have progressed since but am still getting stuck when trying to "compute" a border color for a button.
I have the following define class

<define class="samplerbutton" placeholders="action,rightclick,important=true,textaction,sourcecolor,textsize=13,bordercolorover=bordercolor">
<button action="[ACTION]" rightclick="[RIGHTCLICK]">
<size width="63" height="30"/>
<off color="buttonoff" shape="square" border="[BORDERCOLOROVER]" border_size="1" radius="2"/>
<over color="buttonover" shape="square" border="bordercolor" border_size="1" radius="2"/>
<selected color="padbuttonselected" shape="square" border="buttonon" border_size="1" radius="2"/>
<down color="buttonon" shape="square" border="buttonon" border_size="1" radius="2"/>
<text dx="+1" dy="-8" width="60" fontsize="[TEXTSIZE]" color="textoff2" colorover="textover" weight="bold" colorselected="textselected" colordown="texton" align="center" action="[TEXTACTION]" important="[IMPORTANT]"/>
</button>
<visual x="+14" y="+22" width="34" height="5" type="color" source="[SOURCECOLOR]" visibility="0.8"/>
</define>

then use the buttons like this
<panel class="samplerbutton" x="+0" y="+0" action="sampler_play_stop 1" textaction="get_sample_name 1" sourcecolor="param_equal `get_sample_color 1` '#7FFFFFFF' ? constant '#000000' : sampler_color 1" bordercolorover="#ffffff"/>

<panel class="samplerbutton" x="+69" y="+0" action="sampler_play_stop 2" textaction="get_sample_name 2" sourcecolor="param_equal `get_sample_color 2` '#7FFFFFFF' ? constant '#000000' : sampler_color 2"/>

<panel class="samplerbutton" x="+69+69" y="+0" action="sampler_play_stop 3" textaction="get_sample_name 3" sourcecolor="param_equal `get_sample_color 3` '#7FFFFFFF' ? constant '#000000' : sampler_color 3" bordercolorover="param_equal `get_sample_color 3` '#7FFFFFFF' ? constant '#999999' : sampler_color 3"/>

in the above example, sample button 1 will have a border of white, as defined in the 'bordercolorover' placeholder, showing that my define class is correct, sample button 2 will default to 'bordercolor', however, in sample button 3, the 'sourcecolor' placeholder is calculated correctly to be the color of the sample (or grey if actual color is white), but 'bordercolorover' does not work the same way and the border is black, why can I pass an explicit color to 'bordercolorover' but not a calculated value, the same way I can with the 'sourecolor' placeholder.
I understand that the logic of the 'bordercolorover' in sample button 3 may not make any real sense however in real life I would have a totally different expression there, i am only using it to show that similar expressions work for 'sourcecolor' but not for 'bordercolerover'.
 

Inviato Sat 28 Aug 21 @ 2:53 pm
djkrysrPRO InfinityMember since 2010
OK upon more experimenting, i can only surmise it's the actual value that is being passed that is in the wrong format, so what I need to know is ...
How do I pass a value as part of an expression that is a valid color for the bordercolor because

bordercolorover="#FFFFFF"
will pass correctly to my class

but neither
bordercolorover=" condition ? #FFFFFF : #000000 " nor
bordercolorover=" condition ? constant '#FFFFFF' : constant '#000000' "
will pass the color correctly.
 

Inviato Sat 28 Aug 21 @ 3:26 pm
AdionPRO InfinityCTOMember since 2006
Dynamic colors are currently not supported for border color
 

Inviato Sat 28 Aug 21 @ 3:34 pm