def setup_multicolor(self):
        """ initial setup of multicolor options and variables"""
        # Setup the options for multicolor
        multicolormasterframe = tk.Frame(self.tab_configure)
        channel_choices = sorted(list(self.data.keys()))
        rgb = ['red', 'green', 'blue']
        self.multicolorframes = {color: tk.Frame(multicolormasterframe, bg=color) for color in rgb}
        self.multicolorlabels = {color: tk.Label(self.multicolorframes[color], text=color, bg=color, width=10) for color
                                 in rgb}
        self.multicolorvars = {color: tk.StringVar() for color in rgb}
        self.multicolorpower = {color: tk.DoubleVar() for color in rgb}
        self.multicolormin = {color: tk.DoubleVar() for color in rgb}
        self.multicolormax = {color: tk.DoubleVar() for color in rgb}

        self.multicolordropdowns = {color: tk.OptionMenu(self.multicolorframes[color],
                                                         self.multicolorvars[color],
                                                         *channel_choices) for color in rgb}

        self.multicolorscales = {color: tk.Scale(self.multicolorframes[color],
                                                 variable=self.multicolorpower[color],
                                                 orient=tk.HORIZONTAL,
                                                 from_=self.config.ranges['multi_color_power_min'],
                                                 to_=self.config.ranges['multi_color_power_max'], bg=color,
                                                 resolution=self.config.ranges['multi_color_power_resolution'],
                                                 length=200) for color in rgb}
        self.multicolorminscale = {color: tk.Scale(self.multicolorframes[color],
                                                   variable=self.multicolormin[color],
                                                   orient=tk.HORIZONTAL, from_=0,
                                                   to_=self.config.ranges['multi_color_vmin'], bg=color,
                                                   resolution=self.config.ranges['multi_color_vresolution'],
                                                   length=200) for color in rgb}
        self.multicolormaxscale = {color: tk.Scale(self.multicolorframes[color],
                                                   variable=self.multicolormax[color],
                                                   orient=tk.HORIZONTAL, from_=self.config.ranges['multi_color_vmax'],
                                                   to_=100, bg=color,
                                                   resolution=self.config.ranges['multi_color_vresolution'],
                                                   length=200) for color in rgb}

        for color in rgb:
            self.multicolorvars[color].set(self.config.products_map[self.config.default[color]])
            self.multicolorpower[color].set(self.config.default[color + "_power"])

            self.multicolormin[color].set(0)
            self.multicolormax[color].set(100)
            self.multicolordropdowns[color].config(bg=color, width=10)
            self.multicolorlabels[color].pack(side=tk.LEFT)

            self.multicolorscales[color].pack(side=tk.RIGHT)
            self.multicolormaxscale[color].pack(side=tk.RIGHT)
            self.multicolorminscale[color].pack(side=tk.RIGHT)
            self.multicolordropdowns[color].pack()
            self.multicolorframes[color].pack(fill=tk.BOTH)
        multicolormasterframe.grid(row=1, column=0, columnspan=5, rowspan=3)
def setup_multicolor ( self ) : multicolormasterframe = tk . Frame ( self . tab_configure ) channel_choices = sorted ( list ( self . data . keys ( ) ) ) rgb = [ 'red' , 'green' , 'blue' ] self . multicolorframes = { color : tk . Frame ( multicolormasterframe , bg = color ) for color in rgb } self . multicolorlabels = { color : tk . Label ( self . multicolorframes [ color ] , text = color , bg = color , width = 10 ) for color in rgb } self . multicolorvars = { color : tk . StringVar ( ) for color in rgb } self . multicolorpower = { color : tk . DoubleVar ( ) for color in rgb } self . multicolormin = { color : tk . DoubleVar ( ) for color in rgb } self . multicolormax = { color : tk . DoubleVar ( ) for color in rgb } self . multicolordropdowns = { color : tk . OptionMenu ( self . multicolorframes [ color ] , self . multicolorvars [ color ] , * channel_choices ) for color in rgb } self . multicolorscales = { color : tk . Scale ( self . multicolorframes [ color ] , variable = self . multicolorpower [ color ] , orient = tk . HORIZONTAL , from_ = self . config . ranges [ 'multi_color_power_min' ] , to_ = self . config . ranges [ 'multi_color_power_max' ] , bg = color , resolution = self . config . ranges [ 'multi_color_power_resolution' ] , length = 200 ) for color in rgb } self . multicolorminscale = { color : tk . Scale ( self . multicolorframes [ color ] , variable = self . multicolormin [ color ] , orient = tk . HORIZONTAL , from_ = 0 , to_ = self . config . ranges [ 'multi_color_vmin' ] , bg = color , resolution = self . config . ranges [ 'multi_color_vresolution' ] , length = 200 ) for color in rgb } self . multicolormaxscale = { color : tk . Scale ( self . multicolorframes [ color ] , variable = self . multicolormax [ color ] , orient = tk . HORIZONTAL , from_ = self . config . ranges [ 'multi_color_vmax' ] , to_ = 100 , bg = color , resolution = self . config . ranges [ 'multi_color_vresolution' ] , length = 200 ) for color in rgb } for color in rgb : self . multicolorvars [ color ] . set ( self . config . products_map [ self . config . default [ color ] ] ) self . multicolorpower [ color ] . set ( self . config . default [ color + "_power" ] ) self . multicolormin [ color ] . set ( 0 ) self . multicolormax [ color ] . set ( 100 ) self . multicolordropdowns [ color ] . config ( bg = color , width = 10 ) self . multicolorlabels [ color ] . pack ( side = tk . LEFT ) self . multicolorscales [ color ] . pack ( side = tk . RIGHT ) self . multicolormaxscale [ color ] . pack ( side = tk . RIGHT ) self . multicolorminscale [ color ] . pack ( side = tk . RIGHT ) self . multicolordropdowns [ color ] . pack ( ) self . multicolorframes [ color ] . pack ( fill = tk . BOTH ) multicolormasterframe . grid ( row = 1 , column = 0 , columnspan = 5 , rowspan = 3 )
initial setup of multicolor options and variables