Skip to main content

BUTTON COLOR

This script changes the background color of a button.


FORMAT: BUTTON COLOR ( red_color , green_color , blue_color ) or BUTTON COLOR ( red_color , green_color , blue_color ) or BUTTON COLOR button_name


DEFINITIONS:

  • Button_name: A string with the name of a button in the code input window.
  • Color: A red, green or blue color value 0->100 (RGB color code in percent).
  • Button Opacity: Opacity color with a value 0->100.

You can use this website to see the color codes in percentage.


EXAMPLE 1:

BUTTON COLOR (100,0,0)

Changes the background color of the current button to red.


EXAMPLE 2:

BUTTON COLOR (100,0,0,20)

Changes the background color of the current button to red with an opacity of 20%.

Adjusting the button opacity in this way will only alter the button color whilst maintaining the button text color at 100%.


EXAMPLE 3:

BUTTON COLOR "legend"

Changes the background color of the current button to that from the button named "legend" in the same window.

EXAMPLE 4:

$miss = count "Miss where row = "SHOT"
$made = count "Made" where row = "SHOT"
IF ( $miss > $made, button color (100,0,0), button color (0,100,0))

Obtains the number of instances in the row "SHOT" that contain the label "Miss" and uses it in the variable $miss. Does the same thing for the variable $made, but with the label "Made". If the result of $miss is higher than the result of $made, then the background color of the current button will be red, otherwise it will be green.