Day of Week Rainbow
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © JackSo6

//@version=5
indicator("Day of Week", overlay=true)

show_monday = input.bool(true, "Monday")
show_tuesday = input.bool(true, "Tuesday")
show_wednesday = input.bool(true, "Wednesday")
show_thursday = input.bool(true, "Thursday")
show_friday = input.bool(true, "Friday")
show_saturday = input.bool(true, "Saturday")
show_sunday = input.bool(true, "Sunday")
transp = input.int(85, "Transp", minval=0, maxval=100)

c_monday = color.new(color.red, transp)
c_tuesday = color.new(color.orange, transp)
c_wednesday = color.new(color.yellow, transp)
c_thursday = color.new(color.green, transp)
c_friday = color.new(color.aqua, transp)
c_saturday = color.new(color.blue, transp)
c_sunday = color.new(color.purple, transp)

day = dayofweek
monday = dayofweek.monday
tuesday = dayofweek.tuesday
wednesday = dayofweek.wednesday
thursday = dayofweek.thursday
friday = dayofweek.friday
saturday = dayofweek.saturday
sunday = dayofweek.sunday
bgcolor(show_monday and day == monday ? c_monday : na)
bgcolor(show_tuesday and day == tuesday ? c_tuesday : na)
bgcolor(show_wednesday and day == wednesday ? c_wednesday : na)
bgcolor(show_thursday and day == thursday ? c_thursday : na)
bgcolor(show_friday and day == friday ? c_friday : na)
bgcolor(show_saturday and day == saturday ? c_saturday : na)
bgcolor(show_sunday and day == sunday ? c_sunday : na)