def update_highlights(self, old_highlight_set, new_highlight_set):
        """Unhighlight the thumbnails represented by `old_highlight_set`
        and highlight the ones represented by new_highlight_set.

        Both are sets of thumbkeys.

        """
        with self.thmblock:
            un_hilite_set = old_highlight_set - new_highlight_set
            re_hilite_set = new_highlight_set - old_highlight_set

            # unhighlight thumb labels that should NOT be highlighted any more
            for thumbkey in un_hilite_set:
                if thumbkey in self.thumbDict:
                    namelbl = self.thumbDict[thumbkey].get('namelbl')
                    namelbl.set_color(bg=None, fg=None)

            # highlight new labels that should be
            bg = self.settings.get('label_bg_color', 'lightgreen')
            fg = self.settings.get('label_font_color', 'black')

            for thumbkey in re_hilite_set:
                if thumbkey in self.thumbDict:
                    namelbl = self.thumbDict[thumbkey].get('namelbl')
                    namelbl.set_color(bg=bg, fg=fg)
dataset/ETHPy150Open ejeschke/ginga/ginga/misc/plugins/Thumbs.py/Thumbs.update_highlights/original