peng3d/gui/layered.py
def getColors(self):
        """
        Overrideable function that generates the colors to be used by various styles.
        
        Should return a 5-tuple of ``(bg,o,i,s,h)``\ .
        
        ``bg`` is the base color of the background.
        
        ``o`` is the outer color, it is usually the same as the background color.
        
        ``i`` is the inner color, it is usually lighter than the background color.
        
        ``s`` is the shadow color, it is usually quite a bit darker than the background.
        
        ``h`` is the highlight color, it is usually quite a bit lighter than the background.
        
        The returned values may also be statically overridden by setting the :py:attr:`color_<var>` attribute to anything but ``None``\ .
        """
        
        bg = self.widget.submenu.bg[:3] if isinstance(self.widget.submenu.bg,list) or isinstance(self.widget.submenu.bg,tuple) else [242,241,240]
        bg = bg if self.color_bg is None else self.color_bg
        
        o,i = bg, [min(bg[0]+8,255),min(bg[1]+8,255),min(bg[2]+8,255)]
        s,h = [max(bg[0]-40,0),max(bg[1]-40,0),max(bg[2]-40,0)], [min(bg[0]+12,255),min(bg[1]+12,255),min(bg[2]+12,255)]
        
        o = o if self.color_o is None else self.color_o
        i = i if self.color_i is None else self.color_i
        s = s if self.color_s is None else self.color_s
        h = h if self.color_h is None else self.color_h
        
        # Outer,Inner,Shadow,Highlight
        return bg,o,i,s,h
def getColors(self):
        """
        Overrideable function that generates the colors to be used by various styles.
        
        Should return a 5-tuple of ``(bg,o,i,s,h)``\ .
        
        ``bg`` is the base color of the background.
        
        ``o`` is the outer color, it is usually the same as the background color.
        
        ``i`` is the inner color, it is usually lighter than the background color.
        
        ``s`` is the shadow color, it is usually quite a bit darker than the background.
        
        ``h`` is the highlight color, it is usually quite a bit lighter than the background.
        
        The returned values may also be statically overridden by setting the :py:attr:`color_<var>` attribute to anything but ``None``\ .
        """
        
        bg = self.widget.submenu.bg[:3] if isinstance(self.widget.submenu.bg,list) or isinstance(self.widget.submenu.bg,tuple) else [242,241,240]
        bg = bg if self.color_bg is None else self.color_bg
        
        o,i = bg, [min(bg[0]+8,255),min(bg[1]+8,255),min(bg[2]+8,255)]
        s,h = [max(bg[0]-40,0),max(bg[1]-40,0),max(bg[2]-40,0)], [min(bg[0]+12,255),min(bg[1]+12,255),min(bg[2]+12,255)]
        
        o = o if self.color_o is None else self.color_o
        i = i if self.color_i is None else self.color_i
        s = s if self.color_s is None else self.color_s
        h = h if self.color_h is None else self.color_h
        
        # Outer,Inner,Shadow,Highlight
        return bg,o,i,s,h
Overrideable function that generates the colors to be used by various styles.
        
        Should return a 5-tuple of ``(bg,o,i,s,h)``\ .
        
        ``bg`` is the base color of the background.
        
        ``o`` is the outer color, it is usually the same as the background color.
        
        ``i`` is the inner color, it is usually lighter than the background color.
        
        ``s`` is the shadow color, it is usually quite a bit darker than the background.
        
        ``h`` is the highlight color, it is usually quite a bit lighter than the background.
        
        The returned values may also be statically overridden by setting the :py:attr:`color_<var>` attribute to anything but ``None``\ .