Closed Oleg42-prog closed 7 months ago
Creating child classes based on ColorTrackbars is time-consuming:
class HSVTrackbars(ColorTrackbars): def __init__(self, window_name): super().__init__(window_name, 'hsv') @property def h(self): return self.get_bounds('h') @property def s(self): return self.get_bounds('s') @property def v(self): return self.get_bounds('v')
class RGBTrackbars(ColorTrackbars): def __init__(self, window_name): super().__init__(window_name, 'rgb') @property def r(self): return self.get_bounds('r') @property def g(self): return self.get_bounds('g') @property def b(self): return self.get_bounds('b')
I propose to use dynamic properties
Creating child classes based on ColorTrackbars is time-consuming: