setSelected(isSelected) {
    // We do not store the label span on the category, so use getElementsByClassName.
    const labelDom = this.rowDiv_.getElementsByClassName(
      'blocklyToolboxCategoryLabel',
    )[0];
    if (isSelected) {
      // Change the background color of the div to white.
      this.rowDiv_.style.backgroundColor = 'white';
      // Set the colour of the text to the colour of the category.
      labelDom.style.color = this.colour_;
      this.iconDom_.style.color = this.colour_;
    } else {
      // Set the background back to the original colour.
      this.rowDiv_.style.backgroundColor = this.colour_;
      // Set the text back to white.
      labelDom.style.color = 'white';
      this.iconDom_.style.color = 'white';
    }
    // This is used for accessibility purposes.
    Blockly.utils.aria.setState(
      /** @type {!Element} */ (this.htmlDiv_),
      Blockly.utils.aria.State.SELECTED,
      isSelected,
    );
  }
Sets the style for the category when it is selected or deselected.
@param {boolean} isSelected True if the category has been selected,
    false otherwise.
@override