Sure you can! At least on regular buttons. Not sure how this would work on a toggle button, as they have two "states" and two appereances. But this will work on a regular button at least:
<abs contexttype="opengear" dblinqport="2222" gridsize="20" id="_top">
<meta>
<params>
<param access="1" maxlength="0" name="color" oid="color" type="STRING" value="#1C08C9" widget="default"/>
</params>
</meta>
<param expand="true" height="80" left="20" oid="color" top="20" widget="color-picker-popup" width="180"/>
<button buttontype="push" height="100" left="20" name="Set color" top="120" width="180">
<task tasktype="ogscript">var col = params.getValue('color', 0);
var x = col.length;
if (x == 9) {
col = '#' + col.substring(3);
}
ogscript.setStyle('btn1', 'bg'+col);
ogscript.setStyle('btn2', 'bg'+col);
ogscript.setStyle('btn3', 'bg'+col);</task>
</button>
<button buttontype="push" height="80" id="btn1" left="280" top="20" width="160"/>
<button buttontype="push" height="80" id="btn2" left="280" top="120" width="160"/>
<button buttontype="push" height="80" id="btn3" left="280" top="220" width="160"/>
</abs>
The reason I have that "if" in there to look for the lenght of the string is because if you touch the transparency value of the color picker, DashBoard will put that in as a hex value before the RGB.
If you dont touch it, the value will be #RRGGBB, however if you do touch it and it is anything other than 0, the value will be #AARRGGBB, so the "if" is simply to remove the alpha/transparency.
#DashBoard