code: def _set_default_colors_for_categorical_obs(adata, value_to_plot):
      
      from .. import palettes
  
      categories = adata.obs[value_to_plot].cat.categories
      length = len(categories)
  
      # check if default matplotlib palette has enough colors
      if len(rcParams['axes.prop_cycle'].by_key()['color']) >= length:
          cc = rcParams['axes.prop_cycle']()
          palette = [next(cc)['color'] for _ in range(length)]
  
      else:
          if length <= 28:
              palette = palettes.default_26
          elif length <= len(palettes.default_64):  # 103 colors
              palette = palettes.default_64
          else:
              palette = ['grey' for i in range(length)]
              logg.info('the obs value: "{}" has more than 103 categories. Uniform '
                        '\'grey\' color will be used for all categories.')
  
      adata.uns[value_to_plot + '_colors'] = palette[:length]
docs: Sets the adata.uns[value_to_plot + '_colors'] using default color palettes
  
      Parameters
      ----------
      adata : annData object
      value_to_plot : name of a valid categorical observation
  
      Returns
      -------
      None