Default syntax and the two switch forms
Use switch mode to match a value, or switch on its own line to evaluate boolean conditions in order. Only the first matching branch executes. Its final expression is the result, so break is unnecessary. The complete v6 script below selects a price and then a color. With mode set to Off, the default returns float(na), intentionally hiding the plot.
//@version=6
indicator("Switch default syntax", overlay=true)
mode = input.string("Close", "Source", options=["Close", "Open", "Off"])
price = switch mode
"Close" => close
"Open" => open
=> float(na)
lineColor = switch
close > open => color.green
close < open => color.red
=> color.gray
plot(price, "Selected source", color=lineColor)