This is a sample script for creating the colorful buttons on Google Spreadsheet on Google Apps Script.
There are some interesting features in this script example, combining the use of Google Slides to create buttons and then assigning a script function to the result using the .assignScript()
method.
Source: Creating Colorful Buttons on Google Spreadsheet using Google Apps Script
Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.