(self)
return palette
Return a palette suitable for the current `attr_color`

        This method must be overridden if the widget offers coloring that is
        not based on attribute values.
Return a palette suitable for the current `attr_color`
Return a palette suitable for the current attr_color
def get_palette(self):
        """
        Return a palette suitable for the current `attr_color`

        This method must be overridden if the widget offers coloring that is
        not based on attribute values.
        """
        attr = self.attr_color
        if not attr:
            return None
        palette = attr.palette
        if attr.is_discrete and len(attr.values) >= MAX_COLORS:
            values = self.get_color_labels()
            colors = [palette.palette[attr.to_val(value)]
                      for value in values[:-1]] + [[192, 192, 192]]

            palette = colorpalettes.DiscretePalette.from_colors(colors)
        return palette
def get_palette ( self ) : attr = self . attr_color if not attr : return None palette = attr . palette if attr . is_discrete and len ( attr . values ) >= MAX_COLORS : values = self . get_color_labels ( ) colors = [ palette . palette [ attr . to_val ( value ) ] for value in values [ : - 1 ] ] + [ [ 192 , 192 , 192 ] ] palette = colorpalettes . DiscretePalette . from_colors ( colors ) return palette