$tag @s $(tag) background_music
kill @e[type=interaction,tag=background_music_off]
kill @e[type=interaction,tag=background_music_on]
kill @e[type=text_display,tag=background_music_off]
kill @e[type=text_display,tag=background_music_on]

$summon interaction ^-0.5 ^ ^2.5 {width:0.5f,height:0.25f,response:1b,Tags:["button","setting","background_music_on"],Passengers:[{id:"minecraft:text_display",teleport_duration:1,Rotation:[90F,0F],alignment:"center",Tags:["button","setting","text","background_music_on"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,-0.25f,0f],scale:[0.75f,0.75f,0.75f]},text:'[{"color":"$(color_1)","text":"ON"}]',background:7566195}]}

$summon interaction ^-1.5 ^ ^2.5 {width:0.5f,height:0.25f,response:1b,Tags:["button","setting","background_music_off"],Passengers:[{id:"minecraft:text_display",teleport_duration:1,Rotation:[90F,0F],alignment:"center",Tags:["button","setting","text","background_music_off"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,-0.25f,0f],scale:[0.75f,0.75f,0.75f]},text:'[{"color":"$(color_2)","text":"OFF"}]',background:7566195}]}

execute as @e[type=item_display] run data modify entity @s Rotation set value [180F,0F]
execute as @e[type=text_display] run data modify entity @s Rotation set value [0F,0F]